home *** CD-ROM | disk | FTP | other *** search
/ Apple Macintosh CD: Powe…osh 6100/7100/8100 Series / Apple Macintosh CD - Power Macintosh 6100, 7100, 8100 series.7z / Apple Macintosh CD - Power Macintosh 6100, 7100, 8100 series.bin / Power Macintosh Demo Apps / Wolfram / A Sampling of Mathematica next >
Text File  |  1994-03-01  |  77KB  |  2,605 lines

  1. (*^
  2. ::[    Information =
  3.  
  4.     "This is a Mathematica Notebook file.  It contains ASCII text, and can be
  5.     transferred by email, ftp, or other text-file transfer utility.  It should
  6.     be read or edited using a copy of Mathematica or MathReader.  If you 
  7.     received this as email, use your mail application or copy/paste to save 
  8.     everything from the line containing (*^ down to the line containing ^*)
  9.     into a plain text file.  On some systems you may have to give the file a 
  10.     name ending with ".ma" to allow Mathematica to recognize it as a Notebook.
  11.     The line below identifies what version of Mathematica created this file,
  12.     but it can be opened using any other version as well.";
  13.  
  14.     FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2";
  15.  
  16.     MacintoshStandardFontEncoding; 
  17.     
  18.     fontset = title, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, groupLikeTitle, M18, N18, bold, L2, e8,  24, "Times"; 
  19.     fontset = subtitle, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, groupLikeTitle, M18, N72, L2, e6,  10, "Times"; 
  20.     fontset = subsubtitle, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, groupLikeTitle, M18, N5, L2, e50,  9, "Times"; 
  21.     fontset = section, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, groupLikeSection, M18, O450, bold, L2, a30, e8,  18, "Times"; 
  22.     fontset = subsection, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, groupLikeSection, blackBox, M18, N72, bold, L2, a16,  14, "Times"; 
  23.     fontset = subsubsection, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, groupLikeSection, whiteBox, M18, bold, L2, a16,  12, "Geneva"; 
  24.     fontset = text, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, N3, L2,  12, "Times"; 
  25.     fontset = smalltext, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, L2,  12, "Times"; 
  26.     fontset = input, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, nowordwrap, preserveAspect, groupLikeInput, M18, N23, bold, B65535, L2,  10, "Courier"; 
  27.     fontset = output, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, output, inactive, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, R6185, G15986, B40959, L2,  10, "Courier"; 
  28.     fontset = message, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, R65535, L2,  10, "Courier"; 
  29.     fontset = print, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, preserveAspect, groupLikeOutput, M18, N23, L2,  10, "Courier"; 
  30.     fontset = info, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, preserveAspect, groupLikeOutput, M17, N23, L2,  10, "Courier"; 
  31.     fontset = postscript, PostScript, formatAsPostScript, evaluateAsCurrentKernel, output, inactive, nowordwrap, preserveAspect, groupLikeGraphics, M18, w253, h254, L2,  10, "Courier"; 
  32.     fontset = name, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, L2,  9, "LO Univers 45 LightOblique"; 
  33.     fontset = header, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, noKeepOnOnePage, preserveAspect, M0, L2,  10, "Times"; 
  34.     fontset = leftheader, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, nohscroll, M0, L2,  12, "Palatino"; 
  35.     fontset = footer, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, noKeepOnOnePage, preserveAspect, M0, N72, L2,  6, "B Univers 65 Bold"; 
  36.     fontset = leftfooter, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, center, M0, L2,  12, "Palatino"; 
  37.     fontset = help, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M18, L2,  10, "Geneva"; 
  38.     fontset = clipboard, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, noKeepOnOnePage, preserveAspect, M0, L2,  10, "New York"; 
  39.     fontset = completions, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M0, L2,  10, "New York"; 
  40.     fontset = special1, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, M0, N90, bold, a2,  12, "Geneva"; 
  41.     fontset = special2, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, blackBox, M0, N90, L2, a2, e2,  12, "B Palatino Bold"; 
  42.     fontset = special3, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, center, M-4, L2,  12, "B Palatino Bold"; 
  43.     fontset = special4, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, right, M81, bold, L2,  12, "Geneva"; 
  44.     fontset = special5, Text, formatAsCurrentKernel, evaluateAsCurrentKernel, inactive, nowordwrap, noKeepOnOnePage, preserveAspect, center, M81, L2,  12, "Palatino"; 
  45.     paletteColors = 128; showRuler; 
  46. ]
  47. :[font = title; inactive; preserveAspect; rightWrapOffset = 431; startGroup]
  48. A Sampling of Mathematica
  49.  
  50.  
  51. ;[s]
  52. 3:0,1;14,2;25,1;28,-1;
  53. 3:0,24,17,Courier,1,24,0,0,0;2,26,18,Times,1,24,0,0,0;1,26,18,Times,3,24,0,0,0;
  54. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  55. This file is a Mathematica  notebook that gives some examples of what Mathematica  can do.  For information on how to read this notebook, see the file Read This First!
  56.  
  57. This file is loosely based on the “Tour of Mathematica”   in Mathematica: A System for Doing Mathematics by Computer, Second Edition, by Stephen Wolfram.  This book was published by Addison-Wesley in 1991, and is available at most bookstores.  For information on how to obtain copies of Mathematica  itself, see the section “Buying Mathematica ” in the file Read This First!
  58. ;[s]
  59. 18:0,0;15,1;26,0;70,1;81,0;151,2;168,0;212,1;224,0;230,1;241,0;243,1;285,0;456,1;467,0;501,1;513,0;527,2;544,-1;
  60. 3:9,14,9,Times,0,12,0,0,0;7,14,9,Times,2,12,0,0,0;2,14,9,Times,1,12,0,0,0;
  61. :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  62. Numerical Calculations
  63. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  64. You can use Mathematica  as an enhanced scientific calculator.  Let's start with a simple example. 
  65. ;[s]
  66. 5:0,0;12,1;23,0;82,2;83,0;100,-1;
  67. 3:3,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,14,9,Times,0,12,65535,0,65535;
  68. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  69. 45 + 78
  70. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  71. 123
  72. ;[o]
  73. 123
  74. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  75. The first line here is what you type into Mathematica.  The second line is the result Mathematica  gives.  If you are reading this notebook on a color system, the input and output are blue, with the input in boldface.
  76. ;[s]
  77. 5:0,0;42,1;53,0;86,1;97,0;218,-1;
  78. 2:3,14,9,Times,0,12,0,0,0;2,14,9,Times,2,12,0,0,0;
  79. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  80. Now let's try something more difficult.
  81. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  82. 3^100
  83. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  84. 515377520732011331036461129765621272702107522001
  85. ;[o]
  86. 515377520732011331036461129765621272702107522001
  87. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  88. Unlike a calculator, Mathematica  gives an exact answer for 3 raised to the power 100.
  89. ;[s]
  90. 3:0,0;21,1;32,0;87,-1;
  91. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  92. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  93. Now let's really test out Mathematica.  Here is 3 raised to the power 1000.
  94. ;[s]
  95. 3:0,0;26,1;37,0;76,-1;
  96. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  97. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  98. 3^1000
  99. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  100. 13220708194808066368904552597521443659654220327521481676649\
  101.  2036822682859734670489954077831385060806196390977769687258\
  102.  2355950954582100618911865342725257953674027620225198320803\
  103.  8780147742289648412743904001175886180411289478156230944380\
  104.  6156617305408667449050617812548034440554705439703889581746\
  105.  5368254916136220830268563778582290228416398307887896918556\
  106.  4040848989376093732421718463599386955167650189405881090604\
  107.  2608967143886410281435038564874716583201061436613217310276\
  108.  8902855220001
  109. ;[o]
  110. 13220708194808066368904552597521443659654220327521481676649\
  111.  
  112.  2036822682859734670489954077831385060806196390977769687258\
  113.  
  114.  2355950954582100618911865342725257953674027620225198320803\
  115.  
  116.  8780147742289648412743904001175886180411289478156230944380\
  117.  
  118.  6156617305408667449050617812548034440554705439703889581746\
  119.  
  120.  5368254916136220830268563778582290228416398307887896918556\
  121.  
  122.  4040848989376093732421718463599386955167650189405881090604\
  123.  
  124.  2608967143886410281435038564874716583201061436613217310276\
  125.  
  126.  8902855220001
  127. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  128. This took about half a second on a Macintosh II.
  129. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  130. Here's the result in the form you might get on a calculator.
  131. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  132. N[%]
  133. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  134. "1.32207"*10^"477"
  135. ;[o]
  136.           477
  137. 1.32207 10
  138. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  139. Here is the value of pi to two hundred decimal places.
  140. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  141. N[Pi, 200]
  142. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  143. 3.141592653589793238462643383279502884197169399375105820974\
  144.  9445923078164062862089986280348253421170679821480865132823\
  145.  0664709384460955058223172535940812848111745028410270193852\
  146.  1105559644622948954930382
  147. ;[o]
  148. 3.141592653589793238462643383279502884197169399375105820974\
  149.  
  150.  9445923078164062862089986280348253421170679821480865132823\
  151.  
  152.  0664709384460955058223172535940812848111745028410270193852\
  153.  
  154.  1105559644622948954930382
  155. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  156. Mathematica  knows about a big collection of mathematical functions — most of those you would find in any book of mathematical tables.
  157. ;[s]
  158. 2:0,1;11,0;135,-1;
  159. 2:1,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  160. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  161. BesselJ[5, 34.6]
  162. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  163. 0.0511826
  164. ;[o]
  165. 0.0511826
  166. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  167. Log[4.5 + 2I] 
  168. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  169. 1.59421 + 0.418224*I
  170. ;[o]
  171. 1.59421 + 0.418224 I
  172. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  173. Zeta[1/2 + 14.3 I]
  174. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  175. -0.0119878 + 0.132231*I
  176. ;[o]
  177. -0.0119878 + 0.132231 I
  178. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  179. Mathematica  can do many kinds of exact computations with integers.  FactorInteger gives the factors of an integer.
  180. ;[s]
  181. 5:0,1;11,0;69,3;82,2;83,0;116,-1;
  182. 4:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,14,9,Times,1,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  183. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  184. FactorInteger[70612139395722186]
  185. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  186. The Unformatted text for this cell was not generated.
  187. Use options in the Actions Settings dialog box to control
  188. when Unformatted text is generated.
  189. ;[o]
  190. {{2, 1}, {3, 2}, {43, 5}, {26684839, 1}}
  191. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  192. You can also do all the standard numerical matrix computations with Mathematica.  This computes the inverse of a 2 by 2 matrix.
  193. ;[s]
  194. 3:0,0;68,1;79,0;128,-1;
  195. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  196. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  197. Inverse[{{3.5, 7.2}, {-2.4, 6.4}}]
  198. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  199. The Unformatted text for this cell was not generated.
  200. Use options in the Actions Settings dialog box to control
  201. when Unformatted text is generated.
  202. ;[o]
  203. {{0.16129, -0.181452}, {0.0604839, 0.0882056}}
  204. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  205. This gives a  numerical approximation to the eigenvalues of the matrix computed in the last example. 
  206. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  207. Eigenvalues[%]
  208. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  209. The Unformatted text for this cell was not generated.
  210. Use options in the Actions Settings dialog box to control
  211. when Unformatted text is generated.
  212. ;[o]
  213. {0.124748 + 0.0981812 I, 0.124748 - 0.0981812 I}
  214. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  215. Mathematica  will also solve  linear programming problems. This returns a list
  216. containing the maximum value of the “objective function” and the point at which it is attained.
  217. ;[s]
  218. 2:0,1;11,0;175,-1;
  219. 2:1,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  220. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  221. ConstrainedMax[17 x -20 y + 18 z,
  222.   {x - y + z < 10, x < 5, x + z > 20}, {x, y, z}]
  223. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup; endGroup]
  224. The Unformatted text for this cell was not generated.
  225. Use options in the Actions Settings dialog box to control
  226. when Unformatted text is generated.
  227. ;[o]
  228. {160, {x -> 0, y -> 10, z -> 20}}
  229. :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  230. Algebraic Calculations
  231. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  232. One of the most important features of Mathematica  is its ability to deal with mathematical formulas in algebraic form.
  233. ;[s]
  234. 3:0,0;38,1;49,0;120,-1;
  235. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  236. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  237. (1 + x)^3
  238. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  239. (1 + x)^3
  240. ;[o]
  241.        3
  242. (1 + x)
  243. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  244. This is what Mathematica  does if you type in a simple algebraic expression.
  245. You can expand out the expression like this:
  246. ;[s]
  247. 3:0,0;13,1;24,0;122,-1;
  248. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  249. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  250. Expand[%]
  251. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  252. 1 + 3*x + 3*x^2 + x^3
  253. ;[o]
  254.              2    3
  255. 1 + 3 x + 3 x  + x
  256. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  257. Mathematica  gives an explicit formula for the result.
  258. You can factor this result to get back to what you started from.
  259. % always stands for the last result that Mathematica  gave you.
  260. ;[s]
  261. 6:0,1;11,0;120,2;121,0;161,1;172,0;184,-1;
  262. 3:3,14,9,Times,0,12,0,0,0;2,14,9,Times,2,12,0,0,0;1,14,10,Courier,0,12,0,0,0;
  263. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  264. Factor[%]
  265. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  266. (1 + x)^3
  267. ;[o]
  268.        3
  269. (1 + x)
  270. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  271. Now let's try a more complicated example.
  272. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  273. (1 + 2x + 5y)^7
  274. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  275. (1 + 2*x + 5*y)^7
  276. ;[o]
  277.                7
  278. (1 + 2 x + 5 y)
  279. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  280. Expand[%]
  281. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  282. 1 + 14*x + 84*x^2 + 280*x^3 + 560*x^4 + 672*x^5 + 448*x^6 + 
  283.    128*x^7 + 35*y + 420*x*y + 2100*x^2*y + 5600*x^3*y + 
  284.    8400*x^4*y + 6720*x^5*y + 2240*x^6*y + 525*y^2 + 
  285.    5250*x*y^2 + 21000*x^2*y^2 + 42000*x^3*y^2 + 42000*x^4*y^2 + 
  286.    16800*x^5*y^2 + 4375*y^3 + 35000*x*y^3 + 105000*x^2*y^3 + 
  287.    140000*x^3*y^3 + 70000*x^4*y^3 + 21875*y^4 + 131250*x*y^4 + 
  288.    262500*x^2*y^4 + 175000*x^3*y^4 + 65625*y^5 + 262500*x*y^5 + 
  289.    262500*x^2*y^5 + 109375*y^6 + 218750*x*y^6 + 78125*y^7
  290. ;[o]
  291.                2        3        4        5        6
  292. 1 + 14 x + 84 x  + 280 x  + 560 x  + 672 x  + 448 x  + 
  293.  
  294.         7                          2           3
  295.    128 x  + 35 y + 420 x y + 2100 x  y + 5600 x  y + 
  296.  
  297.          4           5           6          2           2
  298.    8400 x  y + 6720 x  y + 2240 x  y + 525 y  + 5250 x y  + 
  299.  
  300.           2  2          3  2          4  2          5  2
  301.    21000 x  y  + 42000 x  y  + 42000 x  y  + 16800 x  y  + 
  302.  
  303.          3            3           2  3           3  3
  304.    4375 y  + 35000 x y  + 105000 x  y  + 140000 x  y  + 
  305.  
  306.           4  3          4             4           2  4
  307.    70000 x  y  + 21875 y  + 131250 x y  + 262500 x  y  + 
  308.  
  309.            3  4          5             5           2  5
  310.    175000 x  y  + 65625 y  + 262500 x y  + 262500 x  y  + 
  311.  
  312.            6             6          7
  313.    109375 y  + 218750 x y  + 78125 y
  314. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  315. Factor[%]
  316. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  317. (1 + 2*x + 5*y)^7
  318. ;[o]
  319.                7
  320. (1 + 2 x + 5 y)
  321. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  322. With the option setting Trig -> True Mathematica  will do algebraic operations using trigonometric identities.
  323. ;[s]
  324. 5:0,0;24,2;36,0;37,1;49,0;111,-1;
  325. 3:3,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  326. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  327. Expand[ Cos[x]^3 Sin[x]^2, Trig -> True]
  328. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  329. The Unformatted text for this cell was not generated.
  330. Use options in the Actions Settings dialog box to control
  331. when Unformatted text is generated.
  332. ;[o]
  333. Cos[x]   Cos[3 x]   Cos[5 x]
  334. ------ - -------- - --------
  335.   8         16         16
  336. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  337. Mathematica  also does linear algebra on symbolic matrices.
  338. ;[s]
  339. 2:0,1;12,0;60,-1;
  340. 2:1,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  341. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  342. Inverse[{{a, b}, {c, d}}]
  343. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  344. The Unformatted text for this cell was not generated.
  345. Use options in the Actions Settings dialog box to control
  346. when Unformatted text is generated.
  347. ;[o]
  348.        d               b
  349. {{------------, -(------------)}, 
  350.   -(b c) + a d    -(b c) + a d
  351.  
  352.           c              a
  353.   {-(------------), ------------}}
  354.      -(b c) + a d   -(b c) + a d
  355. :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  356. Calculus
  357. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  358. You can use Mathematica  to do calculus. Here's a simple integral.
  359. ;[s]
  360. 3:0,0;12,1;23,0;67,-1;
  361. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  362. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  363. Integrate[x^n, x]
  364. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  365. x^(1 + n)/(1 + n)
  366. ;[o]
  367.  1 + n
  368. x
  369. ------
  370. 1 + n
  371. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  372. Here's a more complicated example.
  373. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  374. Integrate[x/(x^3-1), x]
  375. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  376. (3^(1/2)*ArcTan[(1 + 2*x)/3^(1/2)])/3 + Log[1 - x]/3 - 
  377.    Log[1 + x + x^2]/6
  378. ;[o]
  379.                1 + 2 x
  380. Sqrt[3] ArcTan[-------]                             2
  381.                Sqrt[3]    Log[1 - x]   Log[1 + x + x ]
  382. ----------------------- + ---------- - ---------------
  383.            3                  3               6
  384. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  385. Now let's try differentiating again.
  386. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  387. D[%, x]
  388. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  389. -1/(3*(1 - x)) + 2/(3*(1 + (1 + 2*x)^2/3)) - 
  390.    (1 + 2*x)/(6*(1 + x + x^2))
  391. ;[o]
  392.    -1               2               1 + 2 x
  393. --------- + ------------------ - --------------
  394. 3 (1 - x)                   2                2
  395.                    (1 + 2 x)     6 (1 + x + x )
  396.             3 (1 + ----------)
  397.                        3
  398. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  399. This gives the expression in a different algebraic form. We can get back our original form using Simplify.
  400. ;[s]
  401. 3:0,0;97,1;105,0;107,-1;
  402. 2:2,14,9,Times,0,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  403. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  404. Simplify[%]
  405. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  406. x/(-1 + x^3)
  407. ;[o]
  408.    x
  409. -------
  410.       3
  411. -1 + x
  412. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  413. Mathematica  can also give exact solutions to many definite integrals.
  414. ;[s]
  415. 2:0,1;11,0;71,-1;
  416. 2:1,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  417. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  418. Integrate[ Sin[x]^10 Cos[x]^5 / x^10, {x, 0, Infinity}]
  419. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  420. The Unformatted text for this cell was not generated.
  421. Use options in the Actions Settings dialog box to control
  422. when Unformatted text is generated.
  423. ;[o]
  424. 40221457 Pi
  425. -----------
  426.  297271296
  427. :[font = text; inactive; preserveAspect]
  428.  
  429. Here's another example.
  430. :[font = input; preserveAspect; startGroup]
  431. Integrate[ Log[x] (1 + x^2)^(-2), {x, 0, 1}]
  432. :[font = output; output; inactive; preserveAspect; endGroup]
  433. -(4*Catalan + Pi)/8
  434. ;[o]
  435. -(4 Catalan + Pi)
  436. -----------------
  437.         8
  438. :[font = text; inactive; preserveAspect]
  439. Most integrals found in any book of tables can be done by Mathematica.
  440. ;[s]
  441. 3:0,0;58,1;69,0;71,-1;
  442. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  443. :[font = input; preserveAspect; startGroup]
  444. Integrate[ Log[x]^6/(1 + x^2),  {x, 0, 1}]
  445. :[font = output; output; inactive; preserveAspect; endGroup]
  446. (61*Pi^7)/256
  447. ;[o]
  448.      7
  449. 61 Pi
  450. ------
  451.  256
  452. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  453. Many integrals do not have a “closed form solution”.  If you give Mathematica  such a definite integral it will be returned unevaluated. You can still use N to get a numerical answer.
  454. ;[s]
  455. 5:0,0;66,1;77,0;155,2;156,0;184,-1;
  456. 3:3,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,13,9,Times,1,10,0,0,0;
  457. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  458. Integrate[ Sin[ Sin[x]], {x, 0, Pi}]
  459. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  460. The Unformatted text for this cell was not generated.
  461. Use options in the Actions Settings dialog box to control
  462. when Unformatted text is generated.
  463. ;[o]
  464. Integrate[Sin[Sin[x]], {x, 0, Pi}]
  465. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  466. N[ % ]
  467. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  468. The Unformatted text for this cell was not generated.
  469. Use options in the Actions Settings dialog box to control
  470. when Unformatted text is generated.
  471. ;[o]
  472. 1.78649
  473. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  474. Mathematica  can also solve differential equations. Here is a pair of simultaneous differential equations. The solution you get involves two undetermined coefficients.
  475. ;[s]
  476. 2:0,1;11,0;168,-1;
  477. 2:1,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  478. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  479. DSolve[{x'[t] == -y[t], y'[t] == x[t]}, 
  480.                                 {x[t], y[t]}, t]
  481. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  482. The Unformatted text for this cell was not generated.
  483. Use options in the Actions Settings dialog box to control
  484. when Unformatted text is generated.
  485. ;[o]
  486. {{x[t] -> 
  487.  
  488.       -I t          2 I t                    2 I t
  489.      E     (C[1] + E      C[1] - I C[2] + I E      C[2])
  490.      ---------------------------------------------------, 
  491.                               2
  492.  
  493.    y[t] -> 
  494.  
  495.       -I t              2 I t                2 I t
  496.      E     (I C[1] - I E      C[1] + C[2] + E      C[2])
  497.      ---------------------------------------------------}}
  498.                               2
  499. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  500. It is a mathematical fact that most differential equations do not have an explicit symbolic solution. In these cases you can get a numerical approximation to the solution using NDSolve.  After the solution is computed it is plotted.
  501. ;[s]
  502. 3:0,0;177,1;184,0;233,-1;
  503. 2:2,14,9,Times,0,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  504. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  505. NDSolve[{y''[x] + Sin[x]^2 y'[x] + y[x] == Cos[x]^2,
  506.      y[0] == 1, y'[0] == 0}, y, {x, 0, 20}]
  507. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  508. The Unformatted text for this cell was not generated.
  509. Use options in the Actions Settings dialog box to control
  510. when Unformatted text is generated.
  511. ;[o]
  512. {{y -> InterpolatingFunction[{0., 20.}, <>]}}
  513. :[font = input; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  514. Plot[ Evaluate[ y[x] /. %], {x, 0, 20} ]
  515. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureLeft = 17; pictureWidth = 282; pictureHeight = 174; endGroup; endGroup; pictureID = 24096]
  516.  
  517. :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  518. Solving Equations
  519. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  520. This is how you solve a quadratic equation in Mathematica.
  521. ;[s]
  522. 3:0,0;46,1;57,0;59,-1;
  523. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  524. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  525. Solve[x^2 + 2 a x + 1 == 0, x]
  526. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  527. {{x -> (-2*a + (-4 + 4*a^2)^(1/2))/2}, 
  528.    {x -> (-2*a - (-4 + 4*a^2)^(1/2))/2}}
  529. ;[o]
  530.                            2
  531.        -2 a + Sqrt[-4 + 4 a ]
  532. {{x -> ----------------------}, 
  533.                  2
  534.  
  535.                              2
  536.          -2 a - Sqrt[-4 + 4 a ]
  537.    {x -> ----------------------}}
  538.                    2
  539. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  540. Here's a more complicated example.
  541. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  542. Solve[x^5 + 3x + 1 == 0, x]
  543. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  544. {ToRules[Roots[3*x + x^5 == -1, x]]}
  545. ;[o]
  546.                       5
  547. {ToRules[Roots[3 x + x  == -1, x]]}
  548. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  549. It is a fact of mathematics that there is no way to get an exact formula for the solutions of a quintic equation like this.  You can nevertheless ask Mathematica  to give you numerical results.  You get the five complex number roots to the equation.
  550. ;[s]
  551. 3:0,0;150,1;162,0;250,-1;
  552. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  553. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  554. N[%]
  555. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  556. {{x -> -0.839072 - 0.943852*I}, 
  557.    {x -> -0.839072 + 0.943852*I}, {x -> -0.331989}, 
  558.    {x -> 1.00507 - 0.937259*I}, {x -> 1.00507 + 0.937259*I}}
  559. ;[o]
  560. {{x -> -0.839072 - 0.943852 I}, 
  561.  
  562.    {x -> -0.839072 + 0.943852 I}, {x -> -0.331989}, 
  563.  
  564.    {x -> 1.00507 - 0.937259 I}, {x -> 1.00507 + 0.937259 I}}
  565. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  566. When equations contain complicated functions there is in general no systematic procedure for finding all solutions, even numerically.  The Mathematica  function FindRoot searches for a numerical solution to an equation, starting at a specified point. 
  567. ;[s]
  568. 5:0,0;139,1;150,0;161,2;169,0;252,-1;
  569. 3:3,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  570. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  571. FindRoot[{Sin[x] == x - y, Cos[y] == x + y},
  572.                          {x, 1}, {y, 0}]
  573. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  574. The Unformatted text for this cell was not generated.
  575. Use options in the Actions Settings dialog box to control
  576. when Unformatted text is generated.
  577. ;[o]
  578. {x -> 0.883402, y -> 0.1105}
  579. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  580. Mathematica  also has an efficient routine for finding the solution to linear equations. Here's a simple example.
  581. ;[s]
  582. 2:0,1;12,0;114,-1;
  583. 2:1,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  584. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  585. LinearSolve[{{1.02, 5.9}, {2.87, 1.9}}, {1.9, 1.06}]
  586. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup; endGroup; endGroup]
  587. The Unformatted text for this cell was not generated.
  588. Use options in the Actions Settings dialog box to control
  589. when Unformatted text is generated.
  590. ;[o]
  591. {0.176325, 0.291551}
  592. :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  593. Graphics
  594. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  595. Here is a simple Mathematica  plot. 
  596. ;[s]
  597. 3:0,0;17,1;28,0;37,-1;
  598. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  599. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  600. Plot[Sin[x], {x, 0, 2Pi}]
  601. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureLeft = 17; pictureWidth = 282; pictureHeight = 174; endGroup; pictureID = 27955]
  602.  
  603. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  604. There are many options you can specify for a plot.  Using Show you can redraw the previous plot with specified options.
  605. ;[s]
  606. 3:0,0;58,1;62,0;120,-1;
  607. 2:2,14,9,Times,0,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  608. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  609. Show[% , Frame -> True, 
  610.             PlotLabel  -> "The Sine Function"]
  611. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureLeft = 17; pictureWidth = 282; pictureHeight = 174; endGroup; pictureID = 25175]
  612.  
  613. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  614. Now for some three-dimensional graphics.
  615. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  616. Plot3D[Sin[x] Sin[3 y] , {x, -2, 2}, {y,-2, 2}]
  617. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureLeft = 2; pictureTop = 1; pictureWidth = 282; pictureHeight = 231; endGroup; pictureID = 287]
  618.  
  619. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  620. Here is a contour plot of the same function.
  621. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  622. Show[ ContourGraphics[ % ], ContourShading -> False,
  623.                             ContourSmoothing -> True]
  624. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureWidth = 282; pictureHeight = 282; endGroup; pictureID = 29547]
  625.  
  626. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  627. This generates a three-dimensional parametric surface.
  628. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  629. ParametricPlot3D[ {u Sin[t], u Cos[t], t/3},
  630.               {t, 0, 12}, {u, -1, 1}, Ticks -> None]
  631. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureWidth = 157; pictureHeight = 252; endGroup; pictureID = 14838]
  632.  
  633. :[font = text; inactive; preserveAspect; rightWrapOffset = 431; endGroup]
  634. Mathematica  generates all graphics in PostScript, so that you can resize pictures, and make use of the resolution available on different types of printers. (Note, however, that to save disk space the graphics in this notebook have been converted into bitmap images, which have lower resolution and do not look as good when resized or printed.  The ability to convert images into bitmap form is useful when space is at a premium, and for animations, which are normally not printed.)
  635. ;[s]
  636. 2:0,1;11,0;483,-1;
  637. 2:1,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  638. :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  639. Animated Graphics 
  640. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  641. You can use sequences of graphics cells in a notebook as frames in a “movie”.
  642. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  643. For information on other controls for viewing Mathematica  movies, see the notebook Read This First!
  644. ;[s]
  645. 4:0,0;46,1;57,0;84,2;101,-1;
  646. 3:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,14,9,Times,1,12,0,0,0;
  647. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  648. This notebook contains a sample of animation in Mathematica.  Due to disk space limitations, this is a simple black and white example.  Look at the Color Movie notebook on your disk for an example of animated color graphics.
  649. ;[s]
  650. 5:0,0;48,1;59,0;148,2;159,0;225,-1;
  651. 3:3,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,14,9,Times,1,12,0,0,0;
  652. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  653. To view the movie:
  654. :[font = text; inactive; preserveAspect; blackDot; leftWrapOffset = 54; rightWrapOffset = 431]
  655. Scroll until the first graphics cell is completely visible in the window.  (The movie is shown in this cell.)
  656. :[font = text; inactive; preserveAspect; blackDot; leftWrapOffset = 54; rightWrapOffset = 431]
  657. Double-click the first picture in the sequence to start the movie.  Click again anywhere to stop.
  658. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  659. For information on other controls for viewing Mathematica  movies, see the notebook Read This First!
  660. ;[s]
  661. 4:0,0;46,1;57,0;84,2;101,-1;
  662. 3:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,14,9,Times,1,12,0,0,0;
  663. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  664.  
  665. :[font = input; dontPreserveAspect; startGroup]
  666. Do[Plot3D[Cos[Sqrt[x^2 + y^2]+Abs[n-2Pi]]/
  667.                               Sqrt[x^2 + y^2 + 1/4],
  668.     {x,-4Pi,4Pi},{y,-4Pi,4Pi},
  669. PlotPoints->26,Lighting->True,PlotRange->{-2,2},
  670. BoxRatios->{1,1,1},Boxed->False,Axes->None],
  671. {n, 0, 2Pi - (2Pi/16), 2Pi/16}]
  672. :[font = postscript; PICT; formatAsPICT; output; inactive; Cclosed; preserveAspect; pictureWidth = 377; pictureHeight = 377; startGroup; pictureID = 723]
  673.  
  674. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 24492]
  675.  
  676. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 31605]
  677.  
  678. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 6708]
  679.  
  680. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 26717]
  681.  
  682. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 27420]
  683.  
  684. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 10921]
  685.  
  686. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 12697]
  687.  
  688. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 6985]
  689.  
  690. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 29613]
  691.  
  692. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 28645]
  693.  
  694. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 10514]
  695.  
  696. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 2807]
  697.  
  698. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 6586]
  699.  
  700. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; pictureID = 17882]
  701.  
  702. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureWidth = 377; pictureHeight = 377; endGroup; endGroup; endGroup; pictureID = 10876]
  703.  
  704. :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  705. Sound
  706. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  707. Mathematica  can produce not only graphics but also sound. Just as you can use Plot to plot a function, you can also use Play to “play” a function.
  708. ;[s]
  709. 6:0,1;12,0;79,2;83,0;121,2;125,0;148,-1;
  710. 3:3,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;2,13,9,Courier,1,10,0,0,0;
  711. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  712. To play a sound, double-click the small, speaker-shaped icon at the top of the sound cell bracket.  Note: When you double-click the sound cell itself, Mathematica  treats it as an animated graphic and plays it repeatedly.  To stop, click again anywhere.
  713. ;[s]
  714. 3:0,0;151,1;162,0;254,-1;
  715. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  716. :[font = text; inactive; preserveAspect]
  717.  
  718. Here are two examples of sound that use frequency modulation.  
  719. In the first example the modulating frequency is in the sub-audio range giving a "vibrato"
  720. effect.
  721. :[font = input; preserveAspect; startGroup]
  722. Play[Sin[ 2 Pi 440 t + Sin[ 2 Pi 10 t ] ], {t, 0, 1}]
  723. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; pictureLeft = 83; pictureWidth = 160; pictureHeight = 98; endGroup; pictureID = 11409; soundID = 23682]
  724.  
  725. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  726. This plays a more complex sound.  It is the superposition or sum of two modulated 
  727. waves.
  728. :[font = input; dontPreserveAspect; startGroup]
  729. Play[Sin[1000 t Sin[Mod[100 t, 1]]] + 
  730.                 Sin[1000 t ( 1 + 0.1 Sin[100 t])], {t, 0, 3}]
  731. :[font = postscript; PICT; formatAsPICT; output; inactive; dontPreserveAspect; pictureWidth = 374; pictureHeight = 98; endGroup; endGroup; pictureID = 7864; soundID = 23241]
  732.  
  733. :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  734. Programming in Mathematica  
  735. ;[s]
  736. 3:0,1;15,2;26,1;29,-1;
  737. 3:0,19,13,Courier,1,18,0,0,0;2,20,14,Times,1,18,0,0,0;1,20,14,Times,3,18,0,0,0;
  738. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  739. You can use Mathematica  not only as a “calculator”, but also as a full symbolic programming language.
  740.  
  741. Many application packages covering specific areas have been or are being written in the Mathematica  language.
  742. ;[s]
  743. 6:0,1;0,0;12,1;23,0;192,1;204,0;215,-1;
  744. 2:3,14,9,Times,0,12,0,0,0;3,14,9,Times,2,12,0,0,0;
  745. :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  746. A Graphics Application Package
  747. :[font = input; preserveAspect; rightWrapOffset = 431]
  748. Needs["Graphics`Polyhedra`"]
  749. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  750. This loads in a package that defines properties of polyhedra.
  751. The package defines, among other things, the geometry of a dodecahedron. The Vertices function gives the coordinates for the faces of the given polyhedron.
  752. Here are the vertices for a dodecahedron shown in shortened form.
  753. :[font = input; preserveAspect; rightWrapOffset = 431]
  754. Vertices[ Dodecahedron ] // Short
  755. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431]
  756. Short[{{0.5257311121191334, 0.3819660112501049, 0.85065080835204}, 
  757.    {-0.2008114158862271, 0.6180339887498946, 0.85065080835204}, 
  758.    {-0.6498393924658123, 0., 0.85065080835204}, 
  759.    {-0.2008114158862271, -0.6180339887498946, 0.85065080835204}, 
  760.    {0.5257311121191334, -0.3819660112501049, 0.85065080835204}, 
  761.    {0.85065080835204, 0.6180339887498946, 0.2008114158862272}, 
  762.    {-0.3249196962329061, 1., 0.2008114158862272}, 
  763.    {-1.051462224238266, 0., 0.2008114158862272}, 
  764.    {-0.3249196962329061, -1., 0.2008114158862272}, 
  765.    {0.85065080835204, -0.6180339887498946, 0.2008114158862272}, 
  766.    {0.3249196962329061, 1., -0.2008114158862272}, 
  767.    {-0.85065080835204, 0.6180339887498949, -0.2008114158862273}, 
  768.    {-0.85065080835204, -0.6180339887498949, -0.2008114158862273}, 
  769.    {0.3249196962329061, -1., -0.2008114158862272}, 
  770.    {1.051462224238266, 0., -0.2008114158862272}, 
  771.    {0.2008114158862272, 0.6180339887498949, -0.85065080835204}, 
  772.    {-0.5257311121191338, 0.3819660112501051, -0.85065080835204}, 
  773.    {-0.5257311121191338, -0.3819660112501051, -0.85065080835204}, 
  774.    {0.2008114158862272, -0.6180339887498949, -0.85065080835204}, 
  775.    {0.6498393924658127, 0., -0.85065080835204}}]
  776. ;[o]
  777. {{0.525731, 0.381966, 0.850651}, <<18>>, {0.649839, 0., -0.850651}}
  778. :[font = text; inactive; preserveAspect]
  779. This shows the dodecahedron as a three-dimensional graphical object.
  780. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  781. Show[ Polyhedron[ Dodecahedron]];
  782. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureLeft = 50; pictureWidth = 282; pictureHeight = 277; endGroup; pictureID = 23349]
  783.  
  784. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  785.  
  786. As another example, we can use the definitions from the polyhedra package to create an image of a stellated icosahedron, which is often used as an icon for the Mathematica  system.
  787. ;[s]
  788. 3:0,0;161,1;173,0;182,-1;
  789. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  790. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  791. Show[ Stellate[ Polyhedron[ Icosahedron ] ] ] ];
  792. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureLeft = 50; pictureWidth = 282; pictureHeight = 277; endGroup; endGroup; pictureID = 18089]
  793.  
  794. :[font = subsection; inactive; Cclosed; preserveAspect; startGroup]
  795. Random Walks
  796. :[font = text; inactive; preserveAspect]
  797. These examples illustrate random walks in various dimensions.
  798. Mathematica's  list operations and plotting routines are combined to give concise 
  799. programs that generate and then plot the random walks.
  800. ;[s]
  801. 3:0,0;62,1;73,0;200,-1;
  802. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  803. :[font = subsubsection; inactive; Cclosed; preserveAspect; startGroup]
  804. One-Dimensional  Random Walk
  805. ;[s]
  806. 3:0,1;3,0;4,1;29,-1;
  807. 2:1,17,12,Geneva,1,12,0,0,0;2,14,9,Times,1,12,0,0,0;
  808. :[font = input; preserveAspect]
  809.  
  810. FoldList[Plus, 0, Table[Random[Real, {-1, 1}], {100}]];
  811. :[font = input; preserveAspect; startGroup]
  812. ListPlot[%, PlotJoined->True]
  813. :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 36; pictureWidth = 266; pictureHeight = 164; endGroup; endGroup]
  814. %!
  815. %%Creator: Mathematica
  816. %%AspectRatio: 0.61803 
  817. MathPictureStart
  818. /Courier findfont 10  scalefont  setfont
  819. % Scaling calculations
  820. 0.0238095 0.00942951 0.0487863 0.0686819 [
  821. [(20)] 0.2124 0.04879 0 2 Msboxa
  822. [(40)] 0.40099 0.04879 0 2 Msboxa
  823. [(60)] 0.58958 0.04879 0 2 Msboxa
  824. [(80)] 0.77817 0.04879 0 2 Msboxa
  825. [(100)] 0.96676 0.04879 0 2 Msboxa
  826. [(2)] 0.01131 0.18615 1 0 Msboxa
  827. [(4)] 0.01131 0.32351 1 0 Msboxa
  828. [(6)] 0.01131 0.46088 1 0 Msboxa
  829. [(8)] 0.01131 0.59824 1 0 Msboxa
  830. [ -0.001 -0.001 0 0 ]
  831. [ 1.001 0.61903 0 0 ]
  832. ] MathScale
  833. % Start of Graphics
  834. 1 setlinecap
  835. 1 setlinejoin
  836. newpath
  837. %%Object: Graphics
  838. [ ] 0 setdash
  839. 0 setgray
  840. gsave
  841. gsave
  842. 0.002 setlinewidth
  843. 0.2124 0.04879 moveto
  844. 0.2124 0.05504 lineto
  845. stroke
  846. grestore
  847. [(20)] 0.2124 0.04879 0 2 Mshowa
  848. gsave
  849. 0.002 setlinewidth
  850. 0.40099 0.04879 moveto
  851. 0.40099 0.05504 lineto
  852. stroke
  853. grestore
  854. [(40)] 0.40099 0.04879 0 2 Mshowa
  855. gsave
  856. 0.002 setlinewidth
  857. 0.58958 0.04879 moveto
  858. 0.58958 0.05504 lineto
  859. stroke
  860. grestore
  861. [(60)] 0.58958 0.04879 0 2 Mshowa
  862. gsave
  863. 0.002 setlinewidth
  864. 0.77817 0.04879 moveto
  865. 0.77817 0.05504 lineto
  866. stroke
  867. grestore
  868. [(80)] 0.77817 0.04879 0 2 Mshowa
  869. gsave
  870. 0.002 setlinewidth
  871. 0.96676 0.04879 moveto
  872. 0.96676 0.05504 lineto
  873. stroke
  874. grestore
  875. [(100)] 0.96676 0.04879 0 2 Mshowa
  876. gsave
  877. 0.001 setlinewidth
  878. 0.06153 0.04879 moveto
  879. 0.06153 0.05254 lineto
  880. stroke
  881. grestore
  882. gsave
  883. 0.001 setlinewidth
  884. 0.09925 0.04879 moveto
  885. 0.09925 0.05254 lineto
  886. stroke
  887. grestore
  888. gsave
  889. 0.001 setlinewidth
  890. 0.13696 0.04879 moveto
  891. 0.13696 0.05254 lineto
  892. stroke
  893. grestore
  894. gsave
  895. 0.001 setlinewidth
  896. 0.17468 0.04879 moveto
  897. 0.17468 0.05254 lineto
  898. stroke
  899. grestore
  900. gsave
  901. 0.001 setlinewidth
  902. 0.25012 0.04879 moveto
  903. 0.25012 0.05254 lineto
  904. stroke
  905. grestore
  906. gsave
  907. 0.001 setlinewidth
  908. 0.28784 0.04879 moveto
  909. 0.28784 0.05254 lineto
  910. stroke
  911. grestore
  912. gsave
  913. 0.001 setlinewidth
  914. 0.32555 0.04879 moveto
  915. 0.32555 0.05254 lineto
  916. stroke
  917. grestore
  918. gsave
  919. 0.001 setlinewidth
  920. 0.36327 0.04879 moveto
  921. 0.36327 0.05254 lineto
  922. stroke
  923. grestore
  924. gsave
  925. 0.001 setlinewidth
  926. 0.43871 0.04879 moveto
  927. 0.43871 0.05254 lineto
  928. stroke
  929. grestore
  930. gsave
  931. 0.001 setlinewidth
  932. 0.47643 0.04879 moveto
  933. 0.47643 0.05254 lineto
  934. stroke
  935. grestore
  936. gsave
  937. 0.001 setlinewidth
  938. 0.51414 0.04879 moveto
  939. 0.51414 0.05254 lineto
  940. stroke
  941. grestore
  942. gsave
  943. 0.001 setlinewidth
  944. 0.55186 0.04879 moveto
  945. 0.55186 0.05254 lineto
  946. stroke
  947. grestore
  948. gsave
  949. 0.001 setlinewidth
  950. 0.6273 0.04879 moveto
  951. 0.6273 0.05254 lineto
  952. stroke
  953. grestore
  954. gsave
  955. 0.001 setlinewidth
  956. 0.66502 0.04879 moveto
  957. 0.66502 0.05254 lineto
  958. stroke
  959. grestore
  960. gsave
  961. 0.001 setlinewidth
  962. 0.70273 0.04879 moveto
  963. 0.70273 0.05254 lineto
  964. stroke
  965. grestore
  966. gsave
  967. 0.001 setlinewidth
  968. 0.74045 0.04879 moveto
  969. 0.74045 0.05254 lineto
  970. stroke
  971. grestore
  972. gsave
  973. 0.001 setlinewidth
  974. 0.81589 0.04879 moveto
  975. 0.81589 0.05254 lineto
  976. stroke
  977. grestore
  978. gsave
  979. 0.001 setlinewidth
  980. 0.85361 0.04879 moveto
  981. 0.85361 0.05254 lineto
  982. stroke
  983. grestore
  984. gsave
  985. 0.001 setlinewidth
  986. 0.89132 0.04879 moveto
  987. 0.89132 0.05254 lineto
  988. stroke
  989. grestore
  990. gsave
  991. 0.001 setlinewidth
  992. 0.92904 0.04879 moveto
  993. 0.92904 0.05254 lineto
  994. stroke
  995. grestore
  996. gsave
  997. 0.002 setlinewidth
  998. 0 0.04879 moveto
  999. 1 0.04879 lineto
  1000. stroke
  1001. grestore
  1002. gsave
  1003. 0.002 setlinewidth
  1004. 0.02381 0.18615 moveto
  1005. 0.03006 0.18615 lineto
  1006. stroke
  1007. grestore
  1008. [(2)] 0.01131 0.18615 1 0 Mshowa
  1009. gsave
  1010. 0.002 setlinewidth
  1011. 0.02381 0.32351 moveto
  1012. 0.03006 0.32351 lineto
  1013. stroke
  1014. grestore
  1015. [(4)] 0.01131 0.32351 1 0 Mshowa
  1016. gsave
  1017. 0.002 setlinewidth
  1018. 0.02381 0.46088 moveto
  1019. 0.03006 0.46088 lineto
  1020. stroke
  1021. grestore
  1022. [(6)] 0.01131 0.46088 1 0 Mshowa
  1023. gsave
  1024. 0.002 setlinewidth
  1025. 0.02381 0.59824 moveto
  1026. 0.03006 0.59824 lineto
  1027. stroke
  1028. grestore
  1029. [(8)] 0.01131 0.59824 1 0 Mshowa
  1030. gsave
  1031. 0.001 setlinewidth
  1032. 0.02381 0.07626 moveto
  1033. 0.02756 0.07626 lineto
  1034. stroke
  1035. grestore
  1036. gsave
  1037. 0.001 setlinewidth
  1038. 0.02381 0.10373 moveto
  1039. 0.02756 0.10373 lineto
  1040. stroke
  1041. grestore
  1042. gsave
  1043. 0.001 setlinewidth
  1044. 0.02381 0.1312 moveto
  1045. 0.02756 0.1312 lineto
  1046. stroke
  1047. grestore
  1048. gsave
  1049. 0.001 setlinewidth
  1050. 0.02381 0.15868 moveto
  1051. 0.02756 0.15868 lineto
  1052. stroke
  1053. grestore
  1054. gsave
  1055. 0.001 setlinewidth
  1056. 0.02381 0.21362 moveto
  1057. 0.02756 0.21362 lineto
  1058. stroke
  1059. grestore
  1060. gsave
  1061. 0.001 setlinewidth
  1062. 0.02381 0.2411 moveto
  1063. 0.02756 0.2411 lineto
  1064. stroke
  1065. grestore
  1066. gsave
  1067. 0.001 setlinewidth
  1068. 0.02381 0.26857 moveto
  1069. 0.02756 0.26857 lineto
  1070. stroke
  1071. grestore
  1072. gsave
  1073. 0.001 setlinewidth
  1074. 0.02381 0.29604 moveto
  1075. 0.02756 0.29604 lineto
  1076. stroke
  1077. grestore
  1078. gsave
  1079. 0.001 setlinewidth
  1080. 0.02381 0.35099 moveto
  1081. 0.02756 0.35099 lineto
  1082. stroke
  1083. grestore
  1084. gsave
  1085. 0.001 setlinewidth
  1086. 0.02381 0.37846 moveto
  1087. 0.02756 0.37846 lineto
  1088. stroke
  1089. grestore
  1090. gsave
  1091. 0.001 setlinewidth
  1092. 0.02381 0.40593 moveto
  1093. 0.02756 0.40593 lineto
  1094. stroke
  1095. grestore
  1096. gsave
  1097. 0.001 setlinewidth
  1098. 0.02381 0.4334 moveto
  1099. 0.02756 0.4334 lineto
  1100. stroke
  1101. grestore
  1102. gsave
  1103. 0.001 setlinewidth
  1104. 0.02381 0.48835 moveto
  1105. 0.02756 0.48835 lineto
  1106. stroke
  1107. grestore
  1108. gsave
  1109. 0.001 setlinewidth
  1110. 0.02381 0.51582 moveto
  1111. 0.02756 0.51582 lineto
  1112. stroke
  1113. grestore
  1114. gsave
  1115. 0.001 setlinewidth
  1116. 0.02381 0.5433 moveto
  1117. 0.02756 0.5433 lineto
  1118. stroke
  1119. grestore
  1120. gsave
  1121. 0.001 setlinewidth
  1122. 0.02381 0.57077 moveto
  1123. 0.02756 0.57077 lineto
  1124. stroke
  1125. grestore
  1126. gsave
  1127. 0.001 setlinewidth
  1128. 0.02381 0.02131 moveto
  1129. 0.02756 0.02131 lineto
  1130. stroke
  1131. grestore
  1132. gsave
  1133. 0.002 setlinewidth
  1134. 0.02381 0 moveto
  1135. 0.02381 0.61803 lineto
  1136. stroke
  1137. grestore
  1138. grestore
  1139. 0 0 moveto
  1140. 1 0 lineto
  1141. 1 0.61803 lineto
  1142. 0 0.61803 lineto
  1143. closepath
  1144. clip
  1145. newpath
  1146. 0.004 setlinewidth
  1147. 0.03324 0.04879 moveto
  1148. 0.04267 0.02962 lineto
  1149. 0.0521 0.02466 lineto
  1150. 0.06153 0.03041 lineto
  1151. 0.07096 0.03661 lineto
  1152. 0.08039 0.01472 lineto
  1153. 0.08982 0.07515 lineto
  1154. 0.09925 0.14202 lineto
  1155. 0.10868 0.09754 lineto
  1156. 0.1181 0.03656 lineto
  1157. 0.12753 0.09946 lineto
  1158. 0.13696 0.10628 lineto
  1159. 0.14639 0.13475 lineto
  1160. 0.15582 0.13862 lineto
  1161. 0.16525 0.19873 lineto
  1162. 0.17468 0.25545 lineto
  1163. 0.18411 0.29712 lineto
  1164. 0.19354 0.34977 lineto
  1165. 0.20297 0.29631 lineto
  1166. 0.2124 0.26082 lineto
  1167. 0.22183 0.28129 lineto
  1168. 0.23126 0.32458 lineto
  1169. 0.24069 0.26758 lineto
  1170. 0.25012 0.33569 lineto
  1171. 0.25955 0.3783 lineto
  1172. 0.26898 0.34565 lineto
  1173. 0.27841 0.34639 lineto
  1174. 0.28784 0.33001 lineto
  1175. 0.29727 0.31472 lineto
  1176. 0.30669 0.3455 lineto
  1177. 0.31612 0.35608 lineto
  1178. 0.32555 0.40588 lineto
  1179. 0.33498 0.41727 lineto
  1180. 0.34441 0.44679 lineto
  1181. 0.35384 0.42433 lineto
  1182. 0.36327 0.4525 lineto
  1183. 0.3727 0.48276 lineto
  1184. 0.38213 0.54358 lineto
  1185. 0.39156 0.54632 lineto
  1186. 0.40099 0.49097 lineto
  1187. 0.41042 0.46254 lineto
  1188. 0.41985 0.51893 lineto
  1189. 0.42928 0.50179 lineto
  1190. 0.43871 0.50259 lineto
  1191. 0.44814 0.43427 lineto
  1192. 0.45757 0.38894 lineto
  1193. 0.467 0.32327 lineto
  1194. 0.47643 0.31404 lineto
  1195. 0.48586 0.32983 lineto
  1196. 0.49529 0.31385 lineto
  1197. Mistroke
  1198. 0.50471 0.35473 lineto
  1199. 0.51414 0.36692 lineto
  1200. 0.52357 0.38266 lineto
  1201. 0.533 0.3399 lineto
  1202. 0.54243 0.37123 lineto
  1203. 0.55186 0.42819 lineto
  1204. 0.56129 0.47255 lineto
  1205. 0.57072 0.40906 lineto
  1206. 0.58015 0.38004 lineto
  1207. 0.58958 0.35984 lineto
  1208. 0.59901 0.41925 lineto
  1209. 0.60844 0.47652 lineto
  1210. 0.61787 0.41156 lineto
  1211. 0.6273 0.38924 lineto
  1212. 0.63673 0.34056 lineto
  1213. 0.64616 0.33456 lineto
  1214. 0.65559 0.30088 lineto
  1215. 0.66502 0.35523 lineto
  1216. 0.67445 0.36456 lineto
  1217. 0.68388 0.40414 lineto
  1218. 0.69331 0.37005 lineto
  1219. 0.70273 0.37282 lineto
  1220. 0.71216 0.37001 lineto
  1221. 0.72159 0.43313 lineto
  1222. 0.73102 0.48561 lineto
  1223. 0.74045 0.49987 lineto
  1224. 0.74988 0.53564 lineto
  1225. 0.75931 0.60332 lineto
  1226. 0.76874 0.5595 lineto
  1227. 0.77817 0.51863 lineto
  1228. 0.7876 0.47133 lineto
  1229. 0.79703 0.43143 lineto
  1230. 0.80646 0.36297 lineto
  1231. 0.81589 0.39202 lineto
  1232. 0.82532 0.41123 lineto
  1233. 0.83475 0.35529 lineto
  1234. 0.84418 0.40279 lineto
  1235. 0.85361 0.45655 lineto
  1236. 0.86304 0.44594 lineto
  1237. 0.87247 0.47973 lineto
  1238. 0.8819 0.44349 lineto
  1239. 0.89132 0.38265 lineto
  1240. 0.90075 0.37926 lineto
  1241. 0.91018 0.34271 lineto
  1242. 0.91961 0.28927 lineto
  1243. 0.92904 0.23603 lineto
  1244. 0.93847 0.16852 lineto
  1245. 0.9479 0.18481 lineto
  1246. 0.95733 0.13821 lineto
  1247. 0.96676 0.20657 lineto
  1248. Mistroke
  1249. 0.97619 0.20915 lineto
  1250. Mfstroke
  1251. % End of Graphics
  1252. MathPictureEnd
  1253. :[font = subsubsection; inactive; Cclosed; preserveAspect; startGroup]
  1254. Two-Dimensional  Random Walk
  1255. ;[s]
  1256. 1:0,1;29,-1;
  1257. 2:0,17,12,Geneva,1,12,0,0,0;1,14,9,Times,1,12,0,0,0;
  1258. :[font = input; preserveAspect]
  1259. FoldList[Plus, {0, 0}, Table[Random[Real, {-1, 1}], {100}, 
  1260.          {2}]];
  1261. :[font = input; preserveAspect; startGroup]
  1262. ListPlot[%, PlotJoined->True]
  1263. :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 36; pictureWidth = 266; pictureHeight = 164; endGroup; endGroup]
  1264. %!
  1265. %%Creator: Mathematica
  1266. %%AspectRatio: 0.61803 
  1267. MathPictureStart
  1268. /Courier findfont 10  scalefont  setfont
  1269. % Scaling calculations
  1270. 0.532661 0.0974204 0.0461965 0.0468417 [
  1271. [(-4)] 0.14298 0.0462 0 2 Msboxa
  1272. [(-2)] 0.33782 0.0462 0 2 Msboxa
  1273. [(2)] 0.7275 0.0462 0 2 Msboxa
  1274. [(4)] 0.92234 0.0462 0 2 Msboxa
  1275. [(2)] 0.52016 0.13988 1 0 Msboxa
  1276. [(4)] 0.52016 0.23356 1 0 Msboxa
  1277. [(6)] 0.52016 0.32725 1 0 Msboxa
  1278. [(8)] 0.52016 0.42093 1 0 Msboxa
  1279. [(10)] 0.52016 0.51461 1 0 Msboxa
  1280. [(12)] 0.52016 0.6083 1 0 Msboxa
  1281. [ -0.001 -0.001 0 0 ]
  1282. [ 1.001 0.61903 0 0 ]
  1283. ] MathScale
  1284. % Start of Graphics
  1285. 1 setlinecap
  1286. 1 setlinejoin
  1287. newpath
  1288. %%Object: Graphics
  1289. [ ] 0 setdash
  1290. 0 setgray
  1291. gsave
  1292. gsave
  1293. 0.002 setlinewidth
  1294. 0.14298 0.0462 moveto
  1295. 0.14298 0.05245 lineto
  1296. stroke
  1297. grestore
  1298. [(-4)] 0.14298 0.0462 0 2 Mshowa
  1299. gsave
  1300. 0.002 setlinewidth
  1301. 0.33782 0.0462 moveto
  1302. 0.33782 0.05245 lineto
  1303. stroke
  1304. grestore
  1305. [(-2)] 0.33782 0.0462 0 2 Mshowa
  1306. gsave
  1307. 0.002 setlinewidth
  1308. 0.7275 0.0462 moveto
  1309. 0.7275 0.05245 lineto
  1310. stroke
  1311. grestore
  1312. [(2)] 0.7275 0.0462 0 2 Mshowa
  1313. gsave
  1314. 0.002 setlinewidth
  1315. 0.92234 0.0462 moveto
  1316. 0.92234 0.05245 lineto
  1317. stroke
  1318. grestore
  1319. [(4)] 0.92234 0.0462 0 2 Mshowa
  1320. gsave
  1321. 0.001 setlinewidth
  1322. 0.18195 0.0462 moveto
  1323. 0.18195 0.04995 lineto
  1324. stroke
  1325. grestore
  1326. gsave
  1327. 0.001 setlinewidth
  1328. 0.22092 0.0462 moveto
  1329. 0.22092 0.04995 lineto
  1330. stroke
  1331. grestore
  1332. gsave
  1333. 0.001 setlinewidth
  1334. 0.25988 0.0462 moveto
  1335. 0.25988 0.04995 lineto
  1336. stroke
  1337. grestore
  1338. gsave
  1339. 0.001 setlinewidth
  1340. 0.29885 0.0462 moveto
  1341. 0.29885 0.04995 lineto
  1342. stroke
  1343. grestore
  1344. gsave
  1345. 0.001 setlinewidth
  1346. 0.37679 0.0462 moveto
  1347. 0.37679 0.04995 lineto
  1348. stroke
  1349. grestore
  1350. gsave
  1351. 0.001 setlinewidth
  1352. 0.41576 0.0462 moveto
  1353. 0.41576 0.04995 lineto
  1354. stroke
  1355. grestore
  1356. gsave
  1357. 0.001 setlinewidth
  1358. 0.45472 0.0462 moveto
  1359. 0.45472 0.04995 lineto
  1360. stroke
  1361. grestore
  1362. gsave
  1363. 0.001 setlinewidth
  1364. 0.49369 0.0462 moveto
  1365. 0.49369 0.04995 lineto
  1366. stroke
  1367. grestore
  1368. gsave
  1369. 0.001 setlinewidth
  1370. 0.57163 0.0462 moveto
  1371. 0.57163 0.04995 lineto
  1372. stroke
  1373. grestore
  1374. gsave
  1375. 0.001 setlinewidth
  1376. 0.6106 0.0462 moveto
  1377. 0.6106 0.04995 lineto
  1378. stroke
  1379. grestore
  1380. gsave
  1381. 0.001 setlinewidth
  1382. 0.64957 0.0462 moveto
  1383. 0.64957 0.04995 lineto
  1384. stroke
  1385. grestore
  1386. gsave
  1387. 0.001 setlinewidth
  1388. 0.68853 0.0462 moveto
  1389. 0.68853 0.04995 lineto
  1390. stroke
  1391. grestore
  1392. gsave
  1393. 0.001 setlinewidth
  1394. 0.76647 0.0462 moveto
  1395. 0.76647 0.04995 lineto
  1396. stroke
  1397. grestore
  1398. gsave
  1399. 0.001 setlinewidth
  1400. 0.80544 0.0462 moveto
  1401. 0.80544 0.04995 lineto
  1402. stroke
  1403. grestore
  1404. gsave
  1405. 0.001 setlinewidth
  1406. 0.84441 0.0462 moveto
  1407. 0.84441 0.04995 lineto
  1408. stroke
  1409. grestore
  1410. gsave
  1411. 0.001 setlinewidth
  1412. 0.88337 0.0462 moveto
  1413. 0.88337 0.04995 lineto
  1414. stroke
  1415. grestore
  1416. gsave
  1417. 0.001 setlinewidth
  1418. 0.10401 0.0462 moveto
  1419. 0.10401 0.04995 lineto
  1420. stroke
  1421. grestore
  1422. gsave
  1423. 0.001 setlinewidth
  1424. 0.06504 0.0462 moveto
  1425. 0.06504 0.04995 lineto
  1426. stroke
  1427. grestore
  1428. gsave
  1429. 0.001 setlinewidth
  1430. 0.02607 0.0462 moveto
  1431. 0.02607 0.04995 lineto
  1432. stroke
  1433. grestore
  1434. gsave
  1435. 0.001 setlinewidth
  1436. 0.96131 0.0462 moveto
  1437. 0.96131 0.04995 lineto
  1438. stroke
  1439. grestore
  1440. gsave
  1441. 0.002 setlinewidth
  1442. 0 0.0462 moveto
  1443. 1 0.0462 lineto
  1444. stroke
  1445. grestore
  1446. gsave
  1447. 0.002 setlinewidth
  1448. 0.53266 0.13988 moveto
  1449. 0.53891 0.13988 lineto
  1450. stroke
  1451. grestore
  1452. [(2)] 0.52016 0.13988 1 0 Mshowa
  1453. gsave
  1454. 0.002 setlinewidth
  1455. 0.53266 0.23356 moveto
  1456. 0.53891 0.23356 lineto
  1457. stroke
  1458. grestore
  1459. [(4)] 0.52016 0.23356 1 0 Mshowa
  1460. gsave
  1461. 0.002 setlinewidth
  1462. 0.53266 0.32725 moveto
  1463. 0.53891 0.32725 lineto
  1464. stroke
  1465. grestore
  1466. [(6)] 0.52016 0.32725 1 0 Mshowa
  1467. gsave
  1468. 0.002 setlinewidth
  1469. 0.53266 0.42093 moveto
  1470. 0.53891 0.42093 lineto
  1471. stroke
  1472. grestore
  1473. [(8)] 0.52016 0.42093 1 0 Mshowa
  1474. gsave
  1475. 0.002 setlinewidth
  1476. 0.53266 0.51461 moveto
  1477. 0.53891 0.51461 lineto
  1478. stroke
  1479. grestore
  1480. [(10)] 0.52016 0.51461 1 0 Mshowa
  1481. gsave
  1482. 0.002 setlinewidth
  1483. 0.53266 0.6083 moveto
  1484. 0.53891 0.6083 lineto
  1485. stroke
  1486. grestore
  1487. [(12)] 0.52016 0.6083 1 0 Mshowa
  1488. gsave
  1489. 0.001 setlinewidth
  1490. 0.53266 0.06493 moveto
  1491. 0.53641 0.06493 lineto
  1492. stroke
  1493. grestore
  1494. gsave
  1495. 0.001 setlinewidth
  1496. 0.53266 0.08367 moveto
  1497. 0.53641 0.08367 lineto
  1498. stroke
  1499. grestore
  1500. gsave
  1501. 0.001 setlinewidth
  1502. 0.53266 0.10241 moveto
  1503. 0.53641 0.10241 lineto
  1504. stroke
  1505. grestore
  1506. gsave
  1507. 0.001 setlinewidth
  1508. 0.53266 0.12114 moveto
  1509. 0.53641 0.12114 lineto
  1510. stroke
  1511. grestore
  1512. gsave
  1513. 0.001 setlinewidth
  1514. 0.53266 0.15862 moveto
  1515. 0.53641 0.15862 lineto
  1516. stroke
  1517. grestore
  1518. gsave
  1519. 0.001 setlinewidth
  1520. 0.53266 0.17735 moveto
  1521. 0.53641 0.17735 lineto
  1522. stroke
  1523. grestore
  1524. gsave
  1525. 0.001 setlinewidth
  1526. 0.53266 0.19609 moveto
  1527. 0.53641 0.19609 lineto
  1528. stroke
  1529. grestore
  1530. gsave
  1531. 0.001 setlinewidth
  1532. 0.53266 0.21483 moveto
  1533. 0.53641 0.21483 lineto
  1534. stroke
  1535. grestore
  1536. gsave
  1537. 0.001 setlinewidth
  1538. 0.53266 0.2523 moveto
  1539. 0.53641 0.2523 lineto
  1540. stroke
  1541. grestore
  1542. gsave
  1543. 0.001 setlinewidth
  1544. 0.53266 0.27104 moveto
  1545. 0.53641 0.27104 lineto
  1546. stroke
  1547. grestore
  1548. gsave
  1549. 0.001 setlinewidth
  1550. 0.53266 0.28977 moveto
  1551. 0.53641 0.28977 lineto
  1552. stroke
  1553. grestore
  1554. gsave
  1555. 0.001 setlinewidth
  1556. 0.53266 0.30851 moveto
  1557. 0.53641 0.30851 lineto
  1558. stroke
  1559. grestore
  1560. gsave
  1561. 0.001 setlinewidth
  1562. 0.53266 0.34598 moveto
  1563. 0.53641 0.34598 lineto
  1564. stroke
  1565. grestore
  1566. gsave
  1567. 0.001 setlinewidth
  1568. 0.53266 0.36472 moveto
  1569. 0.53641 0.36472 lineto
  1570. stroke
  1571. grestore
  1572. gsave
  1573. 0.001 setlinewidth
  1574. 0.53266 0.38346 moveto
  1575. 0.53641 0.38346 lineto
  1576. stroke
  1577. grestore
  1578. gsave
  1579. 0.001 setlinewidth
  1580. 0.53266 0.40219 moveto
  1581. 0.53641 0.40219 lineto
  1582. stroke
  1583. grestore
  1584. gsave
  1585. 0.001 setlinewidth
  1586. 0.53266 0.43967 moveto
  1587. 0.53641 0.43967 lineto
  1588. stroke
  1589. grestore
  1590. gsave
  1591. 0.001 setlinewidth
  1592. 0.53266 0.4584 moveto
  1593. 0.53641 0.4584 lineto
  1594. stroke
  1595. grestore
  1596. gsave
  1597. 0.001 setlinewidth
  1598. 0.53266 0.47714 moveto
  1599. 0.53641 0.47714 lineto
  1600. stroke
  1601. grestore
  1602. gsave
  1603. 0.001 setlinewidth
  1604. 0.53266 0.49588 moveto
  1605. 0.53641 0.49588 lineto
  1606. stroke
  1607. grestore
  1608. gsave
  1609. 0.001 setlinewidth
  1610. 0.53266 0.53335 moveto
  1611. 0.53641 0.53335 lineto
  1612. stroke
  1613. grestore
  1614. gsave
  1615. 0.001 setlinewidth
  1616. 0.53266 0.55209 moveto
  1617. 0.53641 0.55209 lineto
  1618. stroke
  1619. grestore
  1620. gsave
  1621. 0.001 setlinewidth
  1622. 0.53266 0.57082 moveto
  1623. 0.53641 0.57082 lineto
  1624. stroke
  1625. grestore
  1626. gsave
  1627. 0.001 setlinewidth
  1628. 0.53266 0.58956 moveto
  1629. 0.53641 0.58956 lineto
  1630. stroke
  1631. grestore
  1632. gsave
  1633. 0.001 setlinewidth
  1634. 0.53266 0.02746 moveto
  1635. 0.53641 0.02746 lineto
  1636. stroke
  1637. grestore
  1638. gsave
  1639. 0.001 setlinewidth
  1640. 0.53266 0.00872 moveto
  1641. 0.53641 0.00872 lineto
  1642. stroke
  1643. grestore
  1644. gsave
  1645. 0.002 setlinewidth
  1646. 0.53266 0 moveto
  1647. 0.53266 0.61803 lineto
  1648. stroke
  1649. grestore
  1650. grestore
  1651. 0 0 moveto
  1652. 1 0 lineto
  1653. 1 0.61803 lineto
  1654. 0 0.61803 lineto
  1655. closepath
  1656. clip
  1657. newpath
  1658. 0.004 setlinewidth
  1659. 0.53266 0.0462 moveto
  1660. 0.61164 0.05392 lineto
  1661. 0.52274 0.05703 lineto
  1662. 0.61988 0.09643 lineto
  1663. 0.59489 0.07959 lineto
  1664. 0.59569 0.11785 lineto
  1665. 0.62475 0.16134 lineto
  1666. 0.59908 0.20794 lineto
  1667. 0.51055 0.23963 lineto
  1668. 0.47312 0.23876 lineto
  1669. 0.48882 0.19704 lineto
  1670. 0.42328 0.17619 lineto
  1671. 0.36513 0.16653 lineto
  1672. 0.35876 0.14583 lineto
  1673. 0.31753 0.13688 lineto
  1674. 0.32381 0.15577 lineto
  1675. 0.34039 0.16017 lineto
  1676. 0.25306 0.13678 lineto
  1677. 0.29406 0.18099 lineto
  1678. 0.19714 0.17422 lineto
  1679. 0.19285 0.13894 lineto
  1680. 0.13929 0.16452 lineto
  1681. 0.11983 0.16545 lineto
  1682. 0.06333 0.17336 lineto
  1683. 0.08138 0.14942 lineto
  1684. 0.17566 0.17014 lineto
  1685. 0.12613 0.1387 lineto
  1686. 0.04143 0.17588 lineto
  1687. 0.06921 0.1775 lineto
  1688. 0.02381 0.21877 lineto
  1689. 0.05801 0.17792 lineto
  1690. 0.14037 0.13186 lineto
  1691. 0.14486 0.17173 lineto
  1692. 0.12102 0.18613 lineto
  1693. 0.04314 0.15502 lineto
  1694. 0.10322 0.13041 lineto
  1695. 0.15923 0.09221 lineto
  1696. 0.12632 0.11941 lineto
  1697. 0.0579 0.09581 lineto
  1698. 0.13747 0.09722 lineto
  1699. 0.10137 0.12084 lineto
  1700. 0.12323 0.08392 lineto
  1701. 0.12471 0.0848 lineto
  1702. 0.17034 0.05914 lineto
  1703. 0.14295 0.05035 lineto
  1704. 0.16642 0.038 lineto
  1705. 0.16824 0.01472 lineto
  1706. 0.23145 0.05142 lineto
  1707. 0.30803 0.0908 lineto
  1708. 0.29227 0.08498 lineto
  1709. Mistroke
  1710. 0.30232 0.13147 lineto
  1711. 0.22481 0.12052 lineto
  1712. 0.17724 0.09381 lineto
  1713. 0.13631 0.13729 lineto
  1714. 0.19346 0.1514 lineto
  1715. 0.28943 0.17512 lineto
  1716. 0.2403 0.15106 lineto
  1717. 0.26948 0.16705 lineto
  1718. 0.33271 0.19037 lineto
  1719. 0.29017 0.21045 lineto
  1720. 0.33712 0.18966 lineto
  1721. 0.41715 0.20529 lineto
  1722. 0.36416 0.1979 lineto
  1723. 0.28477 0.24051 lineto
  1724. 0.34494 0.24472 lineto
  1725. 0.42671 0.26447 lineto
  1726. 0.41988 0.28268 lineto
  1727. 0.49937 0.27231 lineto
  1728. 0.48202 0.27341 lineto
  1729. 0.49643 0.2553 lineto
  1730. 0.58173 0.2631 lineto
  1731. 0.58991 0.29096 lineto
  1732. 0.53472 0.33199 lineto
  1733. 0.512 0.3586 lineto
  1734. 0.50492 0.32491 lineto
  1735. 0.5912 0.32778 lineto
  1736. 0.65641 0.33521 lineto
  1737. 0.60032 0.33428 lineto
  1738. 0.57164 0.33619 lineto
  1739. 0.58218 0.34068 lineto
  1740. 0.64086 0.31889 lineto
  1741. 0.70825 0.3128 lineto
  1742. 0.66131 0.33754 lineto
  1743. 0.67909 0.37184 lineto
  1744. 0.71918 0.36817 lineto
  1745. 0.72455 0.36702 lineto
  1746. 0.70945 0.38689 lineto
  1747. 0.69773 0.34417 lineto
  1748. 0.79034 0.33959 lineto
  1749. 0.70833 0.31527 lineto
  1750. 0.66054 0.36169 lineto
  1751. 0.62615 0.4023 lineto
  1752. 0.68898 0.437 lineto
  1753. 0.74051 0.48343 lineto
  1754. 0.81051 0.50707 lineto
  1755. 0.83602 0.53505 lineto
  1756. 0.85022 0.53655 lineto
  1757. 0.92534 0.51903 lineto
  1758. 0.96291 0.55581 lineto
  1759. 0.97619 0.55852 lineto
  1760. Mistroke
  1761. 0.91461 0.60332 lineto
  1762. Mfstroke
  1763. % End of Graphics
  1764. MathPictureEnd
  1765. :[font = subsubsection; inactive; Cclosed; preserveAspect; startGroup]
  1766. Three-Dimensional  Random Walk
  1767. ;[s]
  1768. 1:0,1;31,-1;
  1769. 2:0,17,12,Geneva,1,12,0,0,0;1,14,9,Times,1,12,0,0,0;
  1770. :[font = input; preserveAspect]
  1771. FoldList[Plus, {0, 0, 0}, Table[Random[Real, {-1, 1}], {100},
  1772.          {3}]];
  1773. :[font = input; preserveAspect; startGroup]
  1774. Show[Graphics3D[Line[%]]]
  1775.  
  1776. :[font = postscript; PostScript; formatAsPostScript; output; inactive; preserveAspect; pictureLeft = 36; pictureWidth = 242; pictureHeight = 270; endGroup; endGroup; endGroup]
  1777. %!
  1778. %%Creator: Mathematica
  1779. %%AspectRatio: 1.11356 
  1780. MathPictureStart
  1781. /Courier findfont 10  scalefont  setfont
  1782. % Scaling calculations
  1783. -0.038545 1.13871 0.0284677 1.13871 [
  1784. [ 0 0 0 0 ]
  1785. [ 1 1.11356 0 0 ]
  1786. ] MathScale
  1787. % Start of Graphics
  1788. 1 setlinecap
  1789. 1 setlinejoin
  1790. newpath
  1791. %%Object: Graphics3D
  1792. [ ] 0 setdash
  1793. 0 setgray
  1794. 0 0 moveto
  1795. 1 0 lineto
  1796. 1 1.11356 lineto
  1797. 0 1.11356 lineto
  1798. closepath
  1799. clip
  1800. newpath
  1801. gsave
  1802. 0.002 setlinewidth
  1803. 0.0993 0.24101 moveto
  1804. 0.02847 0.7525 lineto
  1805. stroke
  1806. 0.02847 0.7525 moveto
  1807. 0.45855 1.0851 lineto
  1808. stroke
  1809. 0.45855 1.0851 moveto
  1810. 0.46698 0.62263 lineto
  1811. stroke
  1812. 0.46698 0.62263 moveto
  1813. 0.0993 0.24101 lineto
  1814. stroke
  1815. 0.61524 0.02847 moveto
  1816. 0.91605 0.4792 lineto
  1817. stroke
  1818. 0.91605 0.4792 moveto
  1819. 0.97153 0.96226 lineto
  1820. stroke
  1821. 0.97153 0.96226 moveto
  1822. 0.63067 0.55901 lineto
  1823. stroke
  1824. 0.63067 0.55901 moveto
  1825. 0.61524 0.02847 lineto
  1826. stroke
  1827. 0.0993 0.24101 moveto
  1828. 0.02847 0.7525 lineto
  1829. stroke
  1830. 0.02847 0.7525 moveto
  1831. 0.63067 0.55901 lineto
  1832. stroke
  1833. 0.63067 0.55901 moveto
  1834. 0.61524 0.02847 lineto
  1835. stroke
  1836. 0.61524 0.02847 moveto
  1837. 0.0993 0.24101 lineto
  1838. stroke
  1839. 0.46698 0.62263 moveto
  1840. 0.91605 0.4792 lineto
  1841. stroke
  1842. 0.91605 0.4792 moveto
  1843. 0.97153 0.96226 lineto
  1844. stroke
  1845. 0.97153 0.96226 moveto
  1846. 0.45855 1.0851 lineto
  1847. stroke
  1848. 0.45855 1.0851 moveto
  1849. 0.46698 0.62263 lineto
  1850. stroke
  1851. grestore
  1852. gsave
  1853. 0.004 setlinewidth
  1854. 0.42129 0.51719 moveto
  1855. 0.43166 0.48655 lineto
  1856. stroke
  1857. grestore
  1858. gsave
  1859. 0.004 setlinewidth
  1860. 0.35479 0.51971 moveto
  1861. 0.42129 0.51719 lineto
  1862. stroke
  1863. grestore
  1864. gsave
  1865. 0.004 setlinewidth
  1866. 0.3279 0.55289 moveto
  1867. 0.35479 0.51971 lineto
  1868. stroke
  1869. grestore
  1870. gsave
  1871. 0.004 setlinewidth
  1872. 0.45491 0.5491 moveto
  1873. 0.39821 0.55312 lineto
  1874. stroke
  1875. grestore
  1876. gsave
  1877. 0.004 setlinewidth
  1878. 0.48476 0.56392 moveto
  1879. 0.45491 0.5491 lineto
  1880. stroke
  1881. grestore
  1882. gsave
  1883. 0.004 setlinewidth
  1884. 0.50424 0.49169 moveto
  1885. 0.41848 0.443 lineto
  1886. stroke
  1887. grestore
  1888. gsave
  1889. 0.004 setlinewidth
  1890. 0.79368 0.62206 moveto
  1891. 0.77851 0.62562 lineto
  1892. stroke
  1893. grestore
  1894. gsave
  1895. 0.004 setlinewidth
  1896. 0.81926 0.63286 moveto
  1897. 0.79368 0.62206 lineto
  1898. stroke
  1899. grestore
  1900. gsave
  1901. 0.004 setlinewidth
  1902. 0.39821 0.55312 moveto
  1903. 0.3279 0.55289 lineto
  1904. stroke
  1905. grestore
  1906. gsave
  1907. 0.004 setlinewidth
  1908. 0.78854 0.68064 moveto
  1909. 0.8192 0.65011 lineto
  1910. stroke
  1911. grestore
  1912. gsave
  1913. 0.004 setlinewidth
  1914. 0.72785 0.65001 moveto
  1915. 0.78854 0.68064 lineto
  1916. stroke
  1917. grestore
  1918. gsave
  1919. 0.004 setlinewidth
  1920. 0.43166 0.48655 moveto
  1921. 0.50424 0.49169 lineto
  1922. stroke
  1923. grestore
  1924. gsave
  1925. 0.004 setlinewidth
  1926. 0.7613 0.67084 moveto
  1927. 0.72785 0.65001 lineto
  1928. stroke
  1929. grestore
  1930. gsave
  1931. 0.004 setlinewidth
  1932. 0.42929 0.49644 moveto
  1933. 0.44376 0.53394 lineto
  1934. stroke
  1935. grestore
  1936. gsave
  1937. 0.004 setlinewidth
  1938. 0.47535 0.46911 moveto
  1939. 0.42929 0.49644 lineto
  1940. stroke
  1941. grestore
  1942. gsave
  1943. 0.004 setlinewidth
  1944. 0.44376 0.53394 moveto
  1945. 0.45306 0.51319 lineto
  1946. stroke
  1947. grestore
  1948. gsave
  1949. 0.004 setlinewidth
  1950. 0.52963 0.49811 moveto
  1951. 0.47535 0.46911 lineto
  1952. stroke
  1953. grestore
  1954. gsave
  1955. 0.004 setlinewidth
  1956. 0.45306 0.51319 moveto
  1957. 0.48476 0.56392 lineto
  1958. stroke
  1959. grestore
  1960. gsave
  1961. 0.004 setlinewidth
  1962. 0.56957 0.49488 moveto
  1963. 0.50187 0.47203 lineto
  1964. stroke
  1965. grestore
  1966. gsave
  1967. 0.004 setlinewidth
  1968. 0.54683 0.49645 moveto
  1969. 0.56957 0.49488 lineto
  1970. stroke
  1971. grestore
  1972. gsave
  1973. 0.004 setlinewidth
  1974. 0.90293 0.6536 moveto
  1975. 0.81926 0.63286 lineto
  1976. stroke
  1977. grestore
  1978. gsave
  1979. 0.004 setlinewidth
  1980. 0.8192 0.65011 moveto
  1981. 0.90293 0.6536 lineto
  1982. stroke
  1983. grestore
  1984. gsave
  1985. 0.004 setlinewidth
  1986. 0.77851 0.62562 moveto
  1987. 0.73298 0.62002 lineto
  1988. stroke
  1989. grestore
  1990. gsave
  1991. 0.004 setlinewidth
  1992. 0.50187 0.47203 moveto
  1993. 0.52963 0.49811 lineto
  1994. stroke
  1995. grestore
  1996. gsave
  1997. 0.004 setlinewidth
  1998. 0.70471 0.68255 moveto
  1999. 0.73276 0.67066 lineto
  2000. stroke
  2001. grestore
  2002. gsave
  2003. 0.004 setlinewidth
  2004. 0.62414 0.71972 moveto
  2005. 0.70471 0.68255 lineto
  2006. stroke
  2007. grestore
  2008. gsave
  2009. 0.004 setlinewidth
  2010. 0.73276 0.67066 moveto
  2011. 0.7613 0.67084 lineto
  2012. stroke
  2013. grestore
  2014. gsave
  2015. 0.004 setlinewidth
  2016. 0.62831 0.52492 moveto
  2017. 0.54683 0.49645 lineto
  2018. stroke
  2019. grestore
  2020. gsave
  2021. 0.004 setlinewidth
  2022. 0.62462 0.53431 moveto
  2023. 0.62831 0.52492 lineto
  2024. stroke
  2025. grestore
  2026. gsave
  2027. 0.004 setlinewidth
  2028. 0.60495 0.76854 moveto
  2029. 0.62414 0.71972 lineto
  2030. stroke
  2031. grestore
  2032. gsave
  2033. 0.004 setlinewidth
  2034. 0.73298 0.62002 moveto
  2035. 0.7032 0.63741 lineto
  2036. stroke
  2037. grestore
  2038. gsave
  2039. 0.004 setlinewidth
  2040. 0.44396 0.52946 moveto
  2041. 0.35764 0.53905 lineto
  2042. stroke
  2043. grestore
  2044. gsave
  2045. 0.004 setlinewidth
  2046. 0.49673 0.57431 moveto
  2047. 0.44396 0.52946 lineto
  2048. stroke
  2049. grestore
  2050. gsave
  2051. 0.004 setlinewidth
  2052. 0.64455 0.77669 moveto
  2053. 0.60495 0.76854 lineto
  2054. stroke
  2055. grestore
  2056. gsave
  2057. 0.004 setlinewidth
  2058. 0.61964 0.65015 moveto
  2059. 0.57263 0.58092 lineto
  2060. stroke
  2061. grestore
  2062. gsave
  2063. 0.004 setlinewidth
  2064. 0.6177 0.63292 moveto
  2065. 0.61964 0.65015 lineto
  2066. stroke
  2067. grestore
  2068. gsave
  2069. 0.004 setlinewidth
  2070. 0.57263 0.58092 moveto
  2071. 0.49673 0.57431 lineto
  2072. stroke
  2073. grestore
  2074. gsave
  2075. 0.004 setlinewidth
  2076. 0.69813 0.66498 moveto
  2077. 0.67097 0.68467 lineto
  2078. stroke
  2079. grestore
  2080. gsave
  2081. 0.004 setlinewidth
  2082. 0.68695 0.6046 moveto
  2083. 0.69813 0.66498 lineto
  2084. stroke
  2085. grestore
  2086. gsave
  2087. 0.004 setlinewidth
  2088. 0.74018 0.56421 moveto
  2089. 0.68695 0.6046 lineto
  2090. stroke
  2091. grestore
  2092. gsave
  2093. 0.004 setlinewidth
  2094. 0.68411 0.55623 moveto
  2095. 0.74018 0.56421 lineto
  2096. stroke
  2097. grestore
  2098. gsave
  2099. 0.004 setlinewidth
  2100. 0.57388 0.55993 moveto
  2101. 0.64773 0.60362 lineto
  2102. stroke
  2103. grestore
  2104. gsave
  2105. 0.004 setlinewidth
  2106. 0.60371 0.59145 moveto
  2107. 0.57388 0.55993 lineto
  2108. stroke
  2109. grestore
  2110. gsave
  2111. 0.004 setlinewidth
  2112. 0.61885 0.66043 moveto
  2113. 0.60371 0.59145 lineto
  2114. stroke
  2115. grestore
  2116. gsave
  2117. 0.004 setlinewidth
  2118. 0.60192 0.63018 moveto
  2119. 0.61885 0.66043 lineto
  2120. stroke
  2121. grestore
  2122. gsave
  2123. 0.004 setlinewidth
  2124. 0.35764 0.53905 moveto
  2125. 0.29898 0.58854 lineto
  2126. stroke
  2127. grestore
  2128. gsave
  2129. 0.004 setlinewidth
  2130. 0.67097 0.68467 moveto
  2131. 0.6177 0.63292 lineto
  2132. stroke
  2133. grestore
  2134. gsave
  2135. 0.004 setlinewidth
  2136. 0.64773 0.60362 moveto
  2137. 0.69948 0.5775 lineto
  2138. stroke
  2139. grestore
  2140. gsave
  2141. 0.004 setlinewidth
  2142. 0.7032 0.63741 moveto
  2143. 0.68411 0.55623 lineto
  2144. stroke
  2145. grestore
  2146. gsave
  2147. 0.004 setlinewidth
  2148. 0.7298 0.58276 moveto
  2149. 0.67726 0.53162 lineto
  2150. stroke
  2151. grestore
  2152. gsave
  2153. 0.004 setlinewidth
  2154. 0.7105 0.58836 moveto
  2155. 0.7298 0.58276 lineto
  2156. stroke
  2157. grestore
  2158. gsave
  2159. 0.004 setlinewidth
  2160. 0.29898 0.58854 moveto
  2161. 0.37373 0.62749 lineto
  2162. stroke
  2163. grestore
  2164. gsave
  2165. 0.004 setlinewidth
  2166. 0.67726 0.53162 moveto
  2167. 0.62462 0.53431 lineto
  2168. stroke
  2169. grestore
  2170. gsave
  2171. 0.004 setlinewidth
  2172. 0.63891 0.80129 moveto
  2173. 0.64455 0.77669 lineto
  2174. stroke
  2175. grestore
  2176. gsave
  2177. 0.004 setlinewidth
  2178. 0.4328 0.63675 moveto
  2179. 0.41946 0.57405 lineto
  2180. stroke
  2181. grestore
  2182. gsave
  2183. 0.004 setlinewidth
  2184. 0.37373 0.62749 moveto
  2185. 0.4328 0.63675 lineto
  2186. stroke
  2187. grestore
  2188. gsave
  2189. 0.004 setlinewidth
  2190. 0.60427 0.66042 moveto
  2191. 0.60192 0.63018 lineto
  2192. stroke
  2193. grestore
  2194. gsave
  2195. 0.004 setlinewidth
  2196. 0.65401 0.58936 moveto
  2197. 0.7105 0.58836 lineto
  2198. stroke
  2199. grestore
  2200. gsave
  2201. 0.004 setlinewidth
  2202. 0.69948 0.5775 moveto
  2203. 0.65401 0.58936 lineto
  2204. stroke
  2205. grestore
  2206. gsave
  2207. 0.004 setlinewidth
  2208. 0.45992 0.50175 moveto
  2209. 0.48209 0.49971 lineto
  2210. stroke
  2211. grestore
  2212. gsave
  2213. 0.004 setlinewidth
  2214. 0.41946 0.57405 moveto
  2215. 0.45992 0.50175 lineto
  2216. stroke
  2217. grestore
  2218. gsave
  2219. 0.004 setlinewidth
  2220. 0.53135 0.63243 moveto
  2221. 0.60427 0.66042 lineto
  2222. stroke
  2223. grestore
  2224. gsave
  2225. 0.004 setlinewidth
  2226. 0.5713 0.5606 moveto
  2227. 0.53135 0.63243 lineto
  2228. stroke
  2229. grestore
  2230. gsave
  2231. 0.004 setlinewidth
  2232. 0.63884 0.68023 moveto
  2233. 0.58635 0.65571 lineto
  2234. stroke
  2235. grestore
  2236. gsave
  2237. 0.004 setlinewidth
  2238. 0.62034 0.66469 moveto
  2239. 0.63884 0.68023 lineto
  2240. stroke
  2241. grestore
  2242. gsave
  2243. 0.004 setlinewidth
  2244. 0.61318 0.52733 moveto
  2245. 0.5713 0.5606 lineto
  2246. stroke
  2247. grestore
  2248. gsave
  2249. 0.004 setlinewidth
  2250. 0.49712 0.44358 moveto
  2251. 0.52988 0.48896 lineto
  2252. stroke
  2253. grestore
  2254. gsave
  2255. 0.004 setlinewidth
  2256. 0.53853 0.4536 moveto
  2257. 0.49712 0.44358 lineto
  2258. stroke
  2259. grestore
  2260. gsave
  2261. 0.004 setlinewidth
  2262. 0.58635 0.65571 moveto
  2263. 0.66854 0.72616 lineto
  2264. stroke
  2265. grestore
  2266. gsave
  2267. 0.004 setlinewidth
  2268. 0.66854 0.72616 moveto
  2269. 0.63891 0.80129 lineto
  2270. stroke
  2271. grestore
  2272. gsave
  2273. 0.004 setlinewidth
  2274. 0.5372 0.4841 moveto
  2275. 0.53853 0.4536 lineto
  2276. stroke
  2277. grestore
  2278. gsave
  2279. 0.004 setlinewidth
  2280. 0.48209 0.49971 moveto
  2281. 0.5372 0.4841 lineto
  2282. stroke
  2283. grestore
  2284. gsave
  2285. 0.004 setlinewidth
  2286. 0.6585 0.68045 moveto
  2287. 0.62034 0.66469 lineto
  2288. stroke
  2289. grestore
  2290. gsave
  2291. 0.004 setlinewidth
  2292. 0.6113 0.67891 moveto
  2293. 0.6585 0.68045 lineto
  2294. stroke
  2295. grestore
  2296. gsave
  2297. 0.004 setlinewidth
  2298. 0.67533 0.72684 moveto
  2299. 0.6113 0.67891 lineto
  2300. stroke
  2301. grestore
  2302. gsave
  2303. 0.004 setlinewidth
  2304. 0.52988 0.48896 moveto
  2305. 0.61318 0.52733 lineto
  2306. stroke
  2307. grestore
  2308. gsave
  2309. 0.004 setlinewidth
  2310. 0.60526 0.80874 moveto
  2311. 0.67533 0.72684 lineto
  2312. stroke
  2313. grestore
  2314. gsave
  2315. 0.004 setlinewidth
  2316. 0.62946 0.70296 moveto
  2317. 0.60526 0.80874 lineto
  2318. stroke
  2319. grestore
  2320. gsave
  2321. 0.004 setlinewidth
  2322. 0.63892 0.59819 moveto
  2323. 0.62946 0.70296 lineto
  2324. stroke
  2325. grestore
  2326. gsave
  2327. 0.004 setlinewidth
  2328. 0.63296 0.53689 moveto
  2329. 0.63892 0.59819 lineto
  2330. stroke
  2331. grestore
  2332. gsave
  2333. 0.004 setlinewidth
  2334. 0.57352 0.46781 moveto
  2335. 0.63296 0.53689 lineto
  2336. stroke
  2337. grestore
  2338. gsave
  2339. 0.004 setlinewidth
  2340. 0.56979 0.46994 moveto
  2341. 0.57352 0.46781 lineto
  2342. stroke
  2343. grestore
  2344. gsave
  2345. 0.004 setlinewidth
  2346. 0.49417 0.4618 moveto
  2347. 0.51317 0.46662 lineto
  2348. stroke
  2349. grestore
  2350. gsave
  2351. 0.004 setlinewidth
  2352. 0.50834 0.48232 moveto
  2353. 0.49417 0.4618 lineto
  2354. stroke
  2355. grestore
  2356. gsave
  2357. 0.004 setlinewidth
  2358. 0.48562 0.56845 moveto
  2359. 0.53845 0.5741 lineto
  2360. stroke
  2361. grestore
  2362. gsave
  2363. 0.004 setlinewidth
  2364. 0.50017 0.57389 moveto
  2365. 0.48562 0.56845 lineto
  2366. stroke
  2367. grestore
  2368. gsave
  2369. 0.004 setlinewidth
  2370. 0.55119 0.48146 moveto
  2371. 0.56979 0.46994 lineto
  2372. stroke
  2373. grestore
  2374. gsave
  2375. 0.004 setlinewidth
  2376. 0.50666 0.52652 moveto
  2377. 0.56908 0.53454 lineto
  2378. stroke
  2379. grestore
  2380. gsave
  2381. 0.004 setlinewidth
  2382. 0.49551 0.57633 moveto
  2383. 0.50666 0.52652 lineto
  2384. stroke
  2385. grestore
  2386. gsave
  2387. 0.004 setlinewidth
  2388. 0.53072 0.48353 moveto
  2389. 0.49551 0.57633 lineto
  2390. stroke
  2391. grestore
  2392. gsave
  2393. 0.004 setlinewidth
  2394. 0.56908 0.53454 moveto
  2395. 0.55119 0.48146 lineto
  2396. stroke
  2397. grestore
  2398. gsave
  2399. 0.004 setlinewidth
  2400. 0.6159 0.6073 moveto
  2401. 0.68483 0.55892 lineto
  2402. stroke
  2403. grestore
  2404. gsave
  2405. 0.004 setlinewidth
  2406. 0.59366 0.6578 moveto
  2407. 0.6159 0.6073 lineto
  2408. stroke
  2409. grestore
  2410. gsave
  2411. 0.004 setlinewidth
  2412. 0.48847 0.47621 moveto
  2413. 0.50017 0.57389 lineto
  2414. stroke
  2415. grestore
  2416. gsave
  2417. 0.004 setlinewidth
  2418. 0.51317 0.46662 moveto
  2419. 0.48847 0.47621 lineto
  2420. stroke
  2421. grestore
  2422. gsave
  2423. 0.004 setlinewidth
  2424. 0.57118 0.43323 moveto
  2425. 0.50834 0.48232 lineto
  2426. stroke
  2427. grestore
  2428. gsave
  2429. 0.004 setlinewidth
  2430. 0.5052 0.54787 moveto
  2431. 0.53072 0.48353 lineto
  2432. stroke
  2433. grestore
  2434. gsave
  2435. 0.004 setlinewidth
  2436. 0.68483 0.55892 moveto
  2437. 0.61838 0.54469 lineto
  2438. stroke
  2439. grestore
  2440. gsave
  2441. 0.004 setlinewidth
  2442. 0.61838 0.54469 moveto
  2443. 0.57118 0.43323 lineto
  2444. stroke
  2445. grestore
  2446. gsave
  2447. 0.004 setlinewidth
  2448. 0.53845 0.5741 moveto
  2449. 0.5052 0.54787 lineto
  2450. stroke
  2451. grestore
  2452. gsave
  2453. 0.002 setlinewidth
  2454. 0.61524 0.02847 moveto
  2455. 0.91605 0.4792 lineto
  2456. stroke
  2457. 0.91605 0.4792 moveto
  2458. 0.97153 0.96226 lineto
  2459. stroke
  2460. 0.97153 0.96226 moveto
  2461. 0.63067 0.55901 lineto
  2462. stroke
  2463. 0.63067 0.55901 moveto
  2464. 0.61524 0.02847 lineto
  2465. stroke
  2466. 0.0993 0.24101 moveto
  2467. 0.02847 0.7525 lineto
  2468. stroke
  2469. 0.02847 0.7525 moveto
  2470. 0.63067 0.55901 lineto
  2471. stroke
  2472. 0.63067 0.55901 moveto
  2473. 0.61524 0.02847 lineto
  2474. stroke
  2475. 0.61524 0.02847 moveto
  2476. 0.0993 0.24101 lineto
  2477. stroke
  2478. grestore
  2479. gsave
  2480. grestore
  2481. % End of Graphics
  2482. MathPictureEnd
  2483. :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  2484. More on Programming
  2485. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2486. There are several styles of programming in Mathematica.  One of them is procedural programming, as you would find in a standard structured programming language such as C or Pascal.
  2487.  
  2488. Another is “rule-based programming”.  The idea is to give transformation rules which specify how Mathematica  should transform expressions it receives as input. 
  2489.  
  2490. You can give rules that mimic the formulas you might find in a mathematics textbook.
  2491.  
  2492. Here is an example of how you might teach Mathematica  about a new form of logarithm function, called nlog.
  2493. ;[s]
  2494. 9:0,0;43,1;54,0;279,1;290,0;473,1;484,0;533,2;537,0;539,-1;
  2495. 3:5,14,9,Times,0,12,0,0,0;3,14,9,Times,2,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  2496. :[font = input; preserveAspect; rightWrapOffset = 431]
  2497. nlog[a b c d^2]
  2498. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431]
  2499. nlog[a*b*c*d^2]
  2500. ;[o]
  2501.             2
  2502. nlog[a b c d ]
  2503. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2504. Mathematica  initially knows nothing about our new function, so it does nothing to expressions involving nlog.
  2505. ;[s]
  2506. 4:0,1;12,0;105,2;109,0;111,-1;
  2507. 3:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  2508. :[font = input; preserveAspect; rightWrapOffset = 431]
  2509. nlog[x_ y_] := nlog[x] + nlog[y]
  2510. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2511. This tells Mathematica  how to expand out logarithms of products.
  2512. ;[s]
  2513. 3:0,0;11,1;22,0;66,-1;
  2514. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  2515. :[font = input; preserveAspect; rightWrapOffset = 431]
  2516. nlog[a b c d^2]
  2517. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431]
  2518. nlog[a] + nlog[b] + nlog[c] + nlog[d^2]
  2519. ;[o]
  2520.                                     2
  2521. nlog[a] + nlog[b] + nlog[c] + nlog[d ]
  2522. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2523. Now Mathematica  can expand the nlog out. 
  2524. ;[s]
  2525. 5:0,0;4,1;15,0;32,2;36,0;43,-1;
  2526. 3:3,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  2527. :[font = input; preserveAspect; rightWrapOffset = 431]
  2528. nlog[x_^n_] := n nlog[x]
  2529. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2530. This gives a rule for nlog of a power.
  2531. ;[s]
  2532. 3:0,0;22,1;26,0;39,-1;
  2533. 2:2,14,9,Times,0,12,0,0,0;1,13,9,Courier,1,10,0,0,0;
  2534. :[font = input; preserveAspect; rightWrapOffset = 431]
  2535. nlog[a b c d^2]
  2536. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431]
  2537. nlog[a] + nlog[b] + nlog[c] + 2*nlog[d]
  2538. ;[o]
  2539. nlog[a] + nlog[b] + nlog[c] + 2 nlog[d]
  2540. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2541. Now Mathematica  can expand the expression out completely.
  2542. ;[s]
  2543. 3:0,0;4,1;15,0;59,-1;
  2544. 2:2,14,9,Times,0,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  2545. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2546. Another style of programming you can use in Mathematica  is functional programming.  In functional programming, you specify a collection of functions to apply.  This style of programming often yields compact, elegant programs that make good use of Mathematica's many integrated capabilities.
  2547. ;[s]
  2548. 5:0,0;44,1;55,0;248,1;259,0;292,-1;
  2549. 2:3,14,9,Times,0,12,0,0,0;2,14,9,Times,2,12,0,0,0;
  2550. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2551. This is a program that plots the solutions to a polynomial equation as points in the complex plane.
  2552. :[font = input; preserveAspect; rightWrapOffset = 431]
  2553. RootPlot[poly_, z] :=
  2554.   ListPlot[{Re[z], Im[z]} /. NSolve[ poly == 0, z],
  2555.                         AspectRatio -> Automatic ]                                 
  2556. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2557. You can immediately use the program to plot solutions.
  2558. :[font = input; preserveAspect; rightWrapOffset = 431; startGroup]
  2559. RootPlot[ z^7 - 1 , z];
  2560. :[font = postscript; PICT; formatAsPICT; output; inactive; preserveAspect; rightWrapOffset = 431; pictureLeft = 17; pictureWidth = 279; pictureHeight = 287; endGroup; pictureID = 26961]
  2561.  
  2562. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2563. Here is a program written in functional programming style, which finds the first n terms in the continued fraction decomposition of the number x.
  2564. :[font = input; preserveAspect; rightWrapOffset = 431]
  2565. ContinuedFraction[x_Real, n_Integer] :=
  2566.  Floor[ NestList[ 
  2567.      Function[{u}, 1/(u - Floor[u])], x, n - 1] ] 
  2568. :[font = input; preserveAspect; rightWrapOffset = 431]
  2569. ContinuedFraction[.34252515, 7]
  2570. :[font = output; output; inactive; preserveAspect; rightWrapOffset = 431; endGroup; endGroup]
  2571. The Unformatted text for this cell was not generated.
  2572. Use options in the Actions Settings dialog box to control
  2573. when Unformatted text is generated.
  2574. ;[o]
  2575. {0, 2, 1, 11, 2, 2, 1}
  2576. :[font = section; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  2577. The Mathematica User Interface
  2578. ;[s]
  2579. 3:0,1;4,2;15,1;31,-1;
  2580. 3:0,19,13,Courier,1,18,0,0,0;2,20,14,Times,1,18,0,0,0;1,20,14,Times,3,18,0,0,0;
  2581. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2582. Mathematica  consists of two parts — the “kernel”, which actually does computations, and the “front end”, which deals with interaction with the user.  The kernel of Mathematica  is essentially the same on all computers that support Mathematica.  The front end, on the other hand, works differently on different kinds of computer. 
  2583.  
  2584. On the Macintosh, Mathematica  has a sophisticated front end that takes advantage of the Macintosh's unique user interface capabilities.  (You can actually use the Macintosh front end even if you are using a “remote kernel”, say on a supercomputer connected through a network.)
  2585. ;[s]
  2586. 8:0,1;11,0;165,1;176,0;232,1;243,0;350,1;361,0;610,-1;
  2587. 2:4,14,9,Times,0,12,0,0,0;4,14,9,Times,2,12,0,0,0;
  2588. :[font = subsection; inactive; Cclosed; preserveAspect; rightWrapOffset = 431; startGroup]
  2589. Notebooks
  2590. :[font = text; inactive; preserveAspect; rightWrapOffset = 431]
  2591. One of the most important aspects of the Macintosh front end is its ability to support Mathematica  “notebooks”.  
  2592.  
  2593. This file is an example of a notebook.  Notebooks consist of a mixture of text, graphics, sounds and Mathematica  input.
  2594.  
  2595. Notebooks can be used like “interactive textbooks” — you read the text in the notebook, then use the Mathematica  input in the notebook to perform calculations.
  2596. ;[s]
  2597. 7:0,0;87,1;98,0;217,1;229,0;339,1;350,0;399,-1;
  2598. 2:4,14,9,Times,0,12,0,0,0;3,14,9,Times,2,12,0,0,0;
  2599. :[font = text; inactive; preserveAspect; rightWrapOffset = 431; endGroup; endGroup; endGroup]
  2600. Open the notebook called Point Plots and Space Curves to see a typical example of a Mathematica  notebook.
  2601. ;[s]
  2602. 5:0,0;25,1;53,0;84,2;96,0;107,-1;
  2603. 3:3,14,9,Times,0,12,0,0,0;1,14,9,Times,1,12,0,0,0;1,14,9,Times,2,12,0,0,0;
  2604. ^*)
  2605.